https://github.com/misakatat/node-web-screenshot
基于puppeteer与fastify的web截图服务
https://github.com/misakatat/node-web-screenshot
Last synced: 2 months ago
JSON representation
基于puppeteer与fastify的web截图服务
- Host: GitHub
- URL: https://github.com/misakatat/node-web-screenshot
- Owner: MisakaTAT
- License: mit
- Created: 2021-08-19T08:40:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-23T14:55:24.000Z (almost 4 years ago)
- Last Synced: 2025-01-28T12:44:43.617Z (4 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-web-screenshot
基于`Puppeteer`与`Fastify`的Web截图服务# QuickStart
## Clone project
```
git clone https://github.com/MisakaTAT/node-web-screenshot.git
```## Project setup
```
npm install
```## Running project
```
node index.js
```## Usening
```shell
curl "http://127.0.0.1:3000" -H "Content-Type: application/json" -d "{\"url\":\"https://mikuac.com\"}" -X POST
```
Screenshot of the specified element
```json
{
"url": "https://mikuac.com",
"selector": "#aside-user > div > div > a > span > img"
}
```
Full screenshot
```json
{
"url": "https://mikuac.com"
}
```# Puppeteer Heroku Buildpack
```shell
heroku buildpacks:clear -a node-web-screenshot
heroku buildpacks:add --index 1 https://github.com/CoffeeAndCode/puppeteer-heroku-buildpack -a node-web-screenshot
heroku buildpacks:add --index 1 heroku/nodejs -a node-web-screenshot
```