-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
could not understand where should I put app.use(...). #3
Comments
I also just spend few hours trying to solve that. Is there any way to get update on instruction? is it even working with new express version? I would highly appreciate some help. |
Same problem here, I'd love to know where to put the app.use() line. Thanks! |
I too am struggling to work out where to put mean-seo in express.js post the upgrade to express 4.0. I have added in here:
However, mean-seo does not seem to be working as Google is still not caching my page - a search for Polinode and checking cached shows a blank page. |
@apitts, that is the correct place to add it. It's working for me. It took a while before google updated the search results. If you sign up for the google webmaster tools, you can append the escaped fragment to the end of your website url and see if you are getting results. If so, it is working and will just take time for your ranking to improve in my experience. |
Thanks @wesleyfsmith - appreciate it! Yep - I think my issue was actually SSL related, which is fixed now. It's still not rendering all my content so have another issue to solve yet...but certainly getting closer. |
This is what I did and it seems to be working.... when I do curl http://localhost:9000/users/1?_escaped_fragment_= // Setup server app.use(seo({ require('./routes')(app); |
/**
* Configure seo See https://yandex.ru/support/webmaster/robot-workings/ajax-indexing.xml
*/
module.exports.initModulesSeo = function (app) {
app.use(seo({
cacheClient: 'disk', // Can be 'disk' or 'redis'
cacheDuration: 0 // In milliseconds for disk cache
}));
}; Then before this.initModulesSeo(app); |
If I'm mistaken please correct me but isn't
app.use(app.router)
removed from Express 4.https://github.com/visionmedia/express/wiki/Migrating-from-3.x-to-4.x
And if I'm not mistaken again, MEAN is using Exp. 4
Therefore there is no line of
app.use(app.router)
then where should I put
app.use(seo...)
?The text was updated successfully, but these errors were encountered: