Rendertron for NuxtJS and Firestore site for SEO purposes

0 votes

I would like to use Rendertron for my NuxtJS site.

My nuxtjs firestore site is here at https://ampedcast.com and the rendertron site is here: https://render-tron.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.

Feb 20 in Others by Kichu
• 19,040 points
108 views

1 answer to this question.

0 votes

reconfigue the server setting 

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


add the middleware to the nuxt.config.js:


serverMiddleware: [
  { path: "/api", handler: "~/api/rest.js" },
],
answered Feb 21 by narikkadan
• 10,840 points

Related Questions In Others

0 votes
0 answers

Replacing H1 text with a logo image: best method for SEO and accessibility?

i want to link my logo to ...READ MORE

Feb 14 in Others by Kichu
• 19,040 points
638 views
0 votes
1 answer

Replacing H1 text with a logo image: best method for SEO and accessibility?

<h1> <a href="http://stackoverflow.com"> ...READ MORE

answered Feb 21 in Others by narikkadan
• 10,840 points
20 views
0 votes
1 answer

Limit the size of the existing and new permalink slugs in Wordpress for SEO

?php   /**  * Trim native slugs  */ function pm_trim_native_slug($slug, $post_ID, ...READ MORE

answered Feb 25 in Others by narikkadan
• 10,840 points
163 views
0 votes
1 answer

How to use next-seo for setting nextjs meta tag with multiple OGP images?

https://github.com/garmeeh/next-seo use this git repo that contains ...READ MORE

answered Feb 24 in Others by narikkadan
• 10,840 points
235 views
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11 in Others by narikkadan
• 10,840 points
529 views
0 votes
1 answer

Next seo test with react testing library

 you need to mock next/head, pass document.head to the container ...READ MORE

answered Feb 11 in Others by narikkadan
• 10,840 points
195 views
0 votes
0 answers

Angular and SEO indexing

app.config(["$routeProvider", function($routeProvider) { $routeProvider .when("/", ...READ MORE

Feb 14 in Others by Kichu
• 19,040 points
17 views
0 votes
1 answer

AngularJS SEO - Once and for all

java script cant be or wont be ...READ MORE

answered Feb 14 in Others by narikkadan
• 10,840 points
27 views
0 votes
1 answer

AngularJS SEO - Once and for all

javascript is not compiled by google bots ...READ MORE

answered Feb 20 in Others by narikkadan
• 10,840 points
43 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP