Saturday 5 December 2020

Rendertron for NuxtJS and Firestore site for SEO purposes

I would like to use Rendertron for my NuxtJS site.

My nuxtjs firestore site is here at https://ampedcast.com and I have installed Rendertron in google cloud site https://ampedcast-7c1d6.uc.r.appspot.com/

According to this example given by google: https://codelabs.developers.google.com/codelabs/dynamic-rendering#4

I need to add these few lines below to server.js in my nuxtjs site https://ampedcast.com but I could not figure out how to do that. In nuxtjs, you are not supposed to make changes to server.js.

const rendertron = require('rendertron-middleware');

const BOTS = rendertron.botUserAgents.concat('googlebot');
const BOT_UA_PATTERN = new RegExp(BOTS.join('|'), 'i');

app.use(rendertron.makeMiddleware({
  proxyUrl: 'https://ampedcast-7c1d6.uc.r.appspot.com/render',
  userAgentPattern: BOT_UA_PATTERN
}));

Any help or pointers would be greatly appreciated.



from Rendertron for NuxtJS and Firestore site for SEO purposes

No comments:

Post a Comment