Ad

Rails + AngularJS + Prerender.io (local Server) Setup Not Rendering Pages

I am trying to setup Prerender.io server locally. I am Rails + AngularJs app.

Already pulled prerender repo and started the server with node.

$ export PORT=3001
$ node server.js
2015-03-13T08:15:48.152Z starting worker thread #0
2015-03-13T08:15:48.159Z starting worker thread #1
2015-03-13T08:15:48.161Z starting worker thread #2
2015-03-13T08:15:48.163Z starting worker thread #3
2015-03-13T08:15:48.506Z starting phantom on port [12301]
2015-03-13T08:15:48.523Z Server running on port 3001
2015-03-13T08:15:48.524Z starting phantom on port [12304]
2015-03-13T08:15:48.526Z starting phantom on port [12303]
2015-03-13T08:15:48.530Z starting phantom on port [12302]
2015-03-13T08:15:48.541Z Server running on port 3001
2015-03-13T08:15:48.548Z Server running on port 3001
2015-03-13T08:15:48.558Z Server running on port 3001
2015-03-13T08:15:51.750Z started phantom
2015-03-13T08:15:51.755Z started phantom
2015-03-13T08:15:51.757Z started phantom
2015-03-13T08:15:51.758Z started phantom
2015-03-13T08:15:56.715Z getting 

If I hit below URL , I am getting page rendered properly .

localhost:3001/http://localhost:3000/register

But when using Rails Prerender middleware , Page is not rendering and its show empty page. I am hitting below URL.

http://localhost:3000/register?_escaped_fragment_=

It seems , its correctly hitting server and response with status 200 , but page is not displayed.

enter image description here

Output with escape fragment

enter image description here

Any help will be much appreciable. I can provide more details if need.

USING PUMA SERVER

enter image description here

Response from Prerender.io

enter image description here

Ad

Answer

Are you using the Thin webserver? You should make sure you're using a multi process server like Puma or Unicorn since the Rails blocks I/O waiting for the Prerender response.

Ad
source: stackoverflow.com
Ad