38 lines
578 B
Markdown
38 lines
578 B
Markdown
# Screenshot service
|
|
|
|
## Dependencies
|
|
|
|
- `Xvfb`
|
|
- `fluxbox`
|
|
- `firefox-beta`
|
|
|
|
## Building
|
|
|
|
```sh
|
|
docker image build -t headless-fox Docker
|
|
```
|
|
|
|
## Running the server
|
|
|
|
```
|
|
npm start
|
|
```
|
|
|
|
Visit localhost:3000 to see the test form
|
|
|
|
To set up a systemd daemon that starts with the server, use:
|
|
|
|
```
|
|
npm run install-daemon
|
|
```
|
|
|
|
## Testing the API
|
|
|
|
with httpie:
|
|
|
|
```
|
|
http POST localhost:3000/api/requests url==pearson.com 'domains[]==youtube.com' 'domains[]==google.com'
|
|
```
|
|
|
|
It returns a 303 response that redirects to a URL you can poll to see the status of the screenshot request.
|