Answer the question
In order to leave comments, you need to log in
Node.js + Express4 + Angular.js indexing (static pages)?
Colleagues!
The first project in this bundle.
It came to working with bots of search engines and social networks.
This option came to mind:
var express = require('express');
var app = express();
var UAParser = require('ua-parser');
var routes = require('./routes/index');
var staticRoute = require('./routes/test');
var UACheck = function (req, res) {
var ua = req.headers['user-agent'];
ua = UAParser.parseUA(ua)['family'];
if (ua == 'FacebookBot' || ua == 'TwitterBot' || ua == 'Googlebot' || ua == 'Other' || ua == 'Spider'
) {
staticRoute(req, res);
} else {
routes(req, res);
}
}
app.use('/', UACheck);
Answer the question
In order to leave comments, you need to log in
working option. why not?
upd
option may help, via phantom
lawsonry.com/2014/05/diy-angularjs-seo-with-phanto...
or this option
https://github.com/steeve/angular-seo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question