Roast.io is a CDN static web host for Angular 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.
Modern Angular users use the platform-browser/Meta service for managing these meta tags.
AngularJS users use the ngMeta library for managing these meta tags.
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.
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.
Angular doesn't have a mechanism like ReactJS for reusing an existing SSR'd DOM, instead, the browser client rebuilds the DOM which often causes a brief blink/flash during this transition. Hence, the Preboot library.
Roast.io can automatically configure Preboot v4 (not the latest) for you. We use this older version of Preboot because it's simple, and it works for non-Angular projects too.
Just add the
prerendercloud-preboot-app-root attr to your app root. e.g.:
AngularJS v1 users must be using ui-view or ng-view and the
ng-app must be within the
You can read more detail about this integration from Prerender.cloud's docs on preboot