Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TheNoim/ScreenshotService
Simple docker/nodejs screenshot service
https://github.com/TheNoim/ScreenshotService
Last synced: about 2 months ago
JSON representation
Simple docker/nodejs screenshot service
- Host: GitHub
- URL: https://github.com/TheNoim/ScreenshotService
- Owner: TheNoim
- Created: 2019-11-06T12:19:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:44:37.000Z (over 1 year ago)
- Last Synced: 2024-04-16T13:16:40.472Z (5 months ago)
- Language: TypeScript
- Size: 2.94 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Docker Screenshot service
A very simple http docker service to make screenshots of a website.
## HTTP API
### Advanced post method
POST /
Content-Type: application/json
```typescript
interface HTTPBody {
url: string; // Required
styles?: string[]; // CSS file urls getting injected
scrollTo?: string; // CSS selector where the browser will scroll to
hide?: string[]; // List of css selctors of elements getting hidden by the browser
disableAnimations?: boolean /* = true */; // Disable css animations
overlay?: OverlayOptions; // You can enable an optional overlay
viewport?: Viewport;
waitFor?: number; // In ms
waitUntil?: waitUntil[];
device?: string; // get a list of devices by doing a GET request to /devices/
}interface OverlayOptions {
browser?: 'safari-light' | 'safari-dark';
background?: string; // CSS value for the background
}interface Viewport {
width: number;
height: number;
deviceScaleFactor?: number;
isMobile?: boolean;
hasTouch?: boolean;
isLandscape?: boolean;
}type waitUntil = 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
```#### Example body
```json
{
"url": "https://google.com",
"overlay": {
"browser": "safari-dark"
}
}
```### More simple get method
GET /?url=
## Setup own docker container
Docker compose example. Runs on port 3000
```
version: '3.5'
services:
screenshot:
container_name: 'ScreenShotService'
image: noim/screenshot:latest
restart: always
cap_add:
- CAP_SYS_ADMIN
- SYS_ADMIN
```