Node(Nuxt.js) Integration Guide
This guide shows how to integrate Prerender into a NuxtJS 2 project using prerender-node middleware.
This NuxtJS integration is only compatible with NuxtJs 2 and is not compatible with NuxtJs 3 or newer.
Important: Before proceeding, ensure you have access to your Nuxt app code, as it is required to successfully integrate Prerender.
Overview
Use Prerender with NuxtJS 2 to serve pre-rendered pages to search engine crawlers and improve SEO with minimal setup. This guide uses prerender-node via Express middleware.
Installation Steps
-
Install
prerender-nodein your project:npm install prerender-node --save
-
Update
nuxt.config.jsto include middleware:serverMiddleware: [
'~/prerender-middleware.js'
] -
Create
prerender-middleware.jsin your project root:const express = require('express');
const app = express();
app.use(require('prerender-node').set('prerenderToken', 'API TOKEN'));
module.exports = {
path: '/',
handler: app
};
Prerender Token Location:
Verify Your Installation
After integration, it’s important to verify that everything is working as expected. We’ve provided an easy-to-follow guide to help you test your setup and confirm that Prerender is functioning properly.
Is the Prerender integration working on other pages?
Test if the Prerender integration works on the other pages based on this guide: Verify the integration
If you don't see the Prerender headers / IDs, then the Integration is not working, which might be why the other URL is not cached.
Getting an Error?
If you see the message "Prerender Integration Not Detected," you can refer to the troubleshooting guide here to help resolve the issue.
Get Support
If you're still encountering issues after implementing Prerender:
- Review your implementation against our documentation
- Contact our support team:
- Email us at support@prerender.io
- Or click 'Support' > 'Contact Support' at the top-right corner of the dashboard
To help us resolve your issue as quickly as possible, please gather and include any relevant information, such as:
- Error messages you're seeing
- Steps you've already taken to troubleshoot
- Screenshots or screen recordings (if applicable)
Providing these details up front will help our team diagnose the problem more efficiently and get you back on track faster.
Related Articles / FAQs:
- Available integrations
- Node(Express.js)
- How Can I Integrate Prerender With My React/Angular/Vue Application?
- How to check cached versions of your URLs?
- Why Am I Seeing 403 or 404 Errors After Integrating Prerender?
- How to add multiple domains?
- How to add additional bots (integrations maintained by Prerender)