Docs below are for server-side rendering (sometimes referred to as pre-rendering or dynamic rendering). For taking screenshots or PDFs of webpages, see: /docs/api/screenshot-examples
npm install -g prerendercloud-server prerendercloud-server ~/path/to/build
note: Headless-Render-API.com was previously known as Prerender.cloud (rebranded 2022-05-01)
prerendercloud-server is a static, pushstate, Node.js server pre-configured with the official Headless-Render-API.com middleware. Pass it the path to your build/dist directory.
If testing from your dev machine: you will need a public IP or SSH remote port forwarding (we'll prompt you for this). Use ngrok if you don't have a public IP and/or don't want to configure SSH port forwarding.
See example code here: Server-side rendering on Fly.io (this Fly.io integration is how Headless-Render-API.com is hosted)
Read more about pre-rendering using our Docker image here
# run prerendercloud-server for the current directory docker run \ -e PRERENDER_TOKEN="my-secret-token" \ -e DEBUG=prerendercloud \ -p 9000:9000 \ -v $(pwd):/wwwroot \ prerendercloud/webserver # run prerendercloud-server for an s3 bucket docker run \ -e AWS_ACCESS_KEY="my-aws-key" \ -e AWS_SECRET_KEY="my-aws-secret" \ -e PRERENDER_TOKEN="my-secret-token" \ -e DEBUG=prerendercloud \ -p 9000:9000 \ prerendercloud/webserver s3://my-s3-bucket