How can I test the Integration?
  • 18 Nov 2022
  • 2 Minutes to read
  • Contributors
  • Dark
  • PDF

How can I test the Integration?

  • Dark
  • PDF

To test your integration, install your middleware first, then download our open source Prerender server anywhere on your local machine:

Run these commands

git clone
cd prerender
npm install
node server.js

The default port is 3000. Change the server port with export PORT=1337 if needed.

Now you should have a Prerender server running, and you should be able to go to  http://localhost:3000/ and see the Google homepage.

Try switching out Google’s URL with your own! Any relative links won't display correctly here but will be fine once proxied through your server.

Now that we are sure that the Prerender server is working locally let’s move on to the next step.

Testing your middleware:

Set your middleware’s prerenderServiceUrl to point to  http://localhost:3000/ instead of our hosted service.

For example, if you’re using the prerender-node middleware:

	.set('prerenderServiceUrl', 'http://localhost:3000/')
	.set('prerenderToken', 'YOUR\_TOKEN') );

To see a prerendered page exactly how the crawlers will see it, set your User Agent in your browser to Googlebot and visit your URL, or run this on a command line and change to your URL:

curl -sSLI -A googlebot

If your middleware is set up correctly, you should see your page returned! You’ll know it’s correct if you view the source of your page and see all of the HTML in there instead of just the JavaScript.

That’s it! Don’t forget to add your Prerender Token to your middleware and push it to a staging server so you can test it with our hosted service.

Common Problems:

Are you only getting this?


You are probably on Rails or some other framework that uses blocking I/O. You need to switch to a server (like Unicorn or Puma) that lets you start multiple processes or use non-blocking I/O so that there isn’t a deadlock when Prerender tries to render your page on the fly.

Are you still seeing JavaScript and not the static HTML?

In this case, you view the source of your page that should be prerendered, but it looks the same as a non-prerendered page. This usually happens if your middleware or config isn’t high enough in your code to execute it before some other route. Try moving your Prerender middleware configuration higher in your file to see if you can get the Prerender middleware to execute first.

Is your page only partially rendered?

Our Prerender server tries its best to determine when the page is done loading by counting the number of requests in flight. Once the number of requests in flight reaches zero, we wait a short period of time and then save the HTML. If this saves the page too early, you can use our window.prerenderReady flag to notify the server that your page is ready to be saved.

Put this in your HTML:

<script> window.prerenderReady = false; </script>

When we see  window.prerenderReady set to false, we’ll wait until it’s set to true to save the HTML. Execute this when your page will be ready (usually after ajax calls).

window.prerenderReady = true;

Was this article helpful?