Roast.io is a CDN static web host for ReactJS sites/apps. We focus on speed, simplicity, and sensible defaults so you can run
roast deploy and never think about hosting again.
Install our CLI tool with npm:
npm i -g roast and deploy your build/dist directory with
The only configuration you'll need to do is to rewrite 404s to /index.html. You can do this with a _redirects file at the root of your build/dist dir. It just needs one line:
/* /index.html 200
People typically solve this by either configuring their own server to server-side render each request or pre-render their apps at build/compile time.
Roast.io requires neither. Instead we'll do SSR for you using Prerender.cloud, an SSR API.
By default, we limit the SSR to the title and meta tags in the document <head>. You can opt-in to full-page SSR with a _ssr.json file at the root of your deploy.
Server-side rendering won't solve unfurls if you don't have meta tags for open graph. In this case, we'll take a screenshot of the page, and inject the appropriate meta tags so your page unfurls correctly on Facebook, Twitter, Slack, etc.
This autoOg feature is enabled by default. You can disable it by adding a _ssr.json file at the root of your deploy and
To be clear, server-side rendering is not a SEO panacea. It is one tool among many for improving SEO.
Roast.io supports SSR'ing React apps on React versions >= 14. For versions 14 and 15, we'll generate the react-checksum. React 16 no longer uses the checksum (it's capable of attaching to an existing DOM).
If you're not using any asynchronous state (XHR or WebSockets), full-page SSRs should "just work".
You can enable full-page SSR by adding a _ssr.json file at the root of your deploy and setting
Additional configuration is required if you're using AJAX or WebSockets (asynchronous state). You'll need to check if
window.__PRELOADED_STATE__ has the data you need before making an XHR or WebSocket request and if it doesn't, then make the request and write the result to
window.__PRELOADED_STATE__. This is a special variable that Prerender.cloud looks for during the SSR. If exists during the SSR, it be serialized so you can access it in non-SSRd environments.
Roast.io itself is a create-react-app built site. Roast.io is a perfect create-react-app hosting solution because you won't have to manage unfurls or server-side rendering.
npm run build and
roast deploy -p build.
Please note that some versions of CRA include a service-worker by default. This ends up causing some confusion with respect to SSR and routing issues. We recommend you disable the service worker until you're confident the app is working as expected.