📜 ⬆️ ⬇️

Prerender



Open Source solution for full search indexing of your JavaScript applications (Backbone, Angular, Ember, ChaplinJS, Marionette). It works as follows:

  1. Middleware on Ruby on Rails or Node.js checks the user agent on every request to the application
  2. If a search engine crawler is detected, a GET request is sent to Prerender
  3. Prerender calls your application for the page that the crawler requests.
  4. Page rendered using PhantomJS
  5. Received HTML is sent back
  6. Middleware returns HTML to crawler


Node.js

$ npm install prerender-node --save 

 app.use(require('prerender-node')); 

Ruby on rails

 gem 'prerender_rails' 

 config.middleware.use Rack::Prerender 

')
Many thanks to all for your attention.

Source: https://habr.com/ru/post/196718/


All Articles