API

API Endpoint

https://api.roast.io

Authentication

All authentication is done with bearer auth.

Get an API token from the dashboard after logging in, and include it as an HTTP header with all of your requests.


curl: -H "Authorization: Bearer {YOUR_API_TOKEN}"

PUT /api/v1/sites/$SITE_ID/ssr

(Get the $SITE_ID from the dashboard after logging in, and do not include the $ in the actual request)

Note: there are 3 total ways that server-side renders are triggered:

  • by default, only the <head /> (set{ "metaOnly": false } to do full-page) is SSR'd on first-load after a deploy (lazy load)
  • when _ssr.json is configured with {"paths": null}, then your entire site will be crawled on each deploy (plain text sitemaps will also be parsed) and server-side rendered
  • and finally, when a PUT request is sent to the endpoint above with the following JSON


server-side render all pages

curl -X PUT \
  https://api.roast.io/api/v1/sites/$YOUR_SITE_ID/ssr \
  -H 'Content-Type: application/json' \
  -H 'authorization: Bearer $YOUR_API_TOKEN' \
  -d '{"paths":[]}'

server-side render only these 3 paths

curl -X PUT \
  https://api.roast.io/api/v1/sites/$YOUR_SITE_ID/ssr \
  -H 'Content-Type: application/json' \
  -H 'authorization: Bearer $YOUR_API_TOKEN' \
  -d '{"paths":["/", "/docs", "/pricing"]}'

  • Get the {SITE_ID} from the dashboard after logging in.
  • If you have dynamic content, (AJAX/XHR/Websockets, Firebase users), then you'll want to recrawl whenever your content changes.
  • If you have a static site that only changes on deploy, you don't need to use this endpoint.

roast.io

logo

Modern Web Hosting

Contact


support@roast.io


@roast_io