An open API service indexing awesome lists of open source software.

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截图服务

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
```