Server to return static versions of your single page app.
When the server initializes it creates a phantomjs instance and opens a page with the url of the single page app. When the phantom is ready a express instance starts listening for page requests. When the phantom evaluation function detects that the title of the page has changed it returns the current html.
- Swayzee works with the #! escaped_fragment google convention.
- Swayzee works with the watching the window.prerenderReady boolean value, it must be setted to true when the spa finish the rendering process.
- Swayzee asumes that when the title changes means that the page has finished loading.
- Swayzee looks for a this tag in the html
<meta name="prerender-status-code" content="404">
to detect 404 errors.
- Improve the phantom response handling, onConsoleLog i think is not pretty way
- Dynamicly set multiple ORIGINS.
- BlackList
- Caching Handler (Now only avaible s3)
- Point the ORIGIN the url of your server.
-
npm start
ornode swayzee.js --harmony
- Make a request: ``http://localhost:1333/&_escaped_fragment_=/url/example```
Inspired in prerender.io.