Your app already registers prerender-node, and you want crawler requests to go to a different prerender service, such as your own Prerender server. You change two values. Set the PRERENDER_SERVICE_URL environment variable to the new service's address, or call set('prerenderServiceUrl', '') where the middleware is registered. Then set PRERENDER_TOKEN, or call set('prerenderToken', ...), to that service's token. A value set in code wins over the environment variable, so if you have both, change or delete the one in code. Leave the rest of your middleware setup alone.
The catch is where those values live. prerender-node uses a value set in code before it looks at the environment variable. So if your app calls set('prerenderServiceUrl', ...) or set('prerenderToken', ...), changing the environment does nothing. Find every place the values are set first, then change them.
Where prerender-node gets the service URL
The middleware checks if the request is from a crawler by checking the user agent string.…