SEO.js makes your BackboneJS, AngularJS or EmberJS apps crawlable by Google to make them appear in search results
Welcome to SEO.js for Node.js! SEO.js makes your BackboneJS, AngularJS or EmberJS apps crawlable by Google to make them appear in search results. Integrating it to your Node.js (read: Express.js) application is easy.
To get started with seojs install the
$ npm install express-seojs --save
Next you need an API token. To get it sign up at http://getseojs.com/. While you're there add your site in the dashboard so the snapshots can already be prepared.
In your Node.js app you need to include the SEO.js middleware in the initialization section:
var seojs = require'express-seojs';appuseseojs'your_secret_api_token';
After this your
app.js probably looks something like this:
var app = express;// all environmentsappset'port' processenvPORT || 4000;appset'views' __dirname + '/views';appset'view engine' 'ejs';appuseexpressfavicon;appuseexpresslogger'dev';var seojs = require'express-seojs';appuseseojs'your_secret_api_token';appuseexpressbodyParser;appuseexpressmethodOverride;
That's it! Requests to your app containing the _escaped_fragment_ query parameter will now be forwarded to the SEO.js CDN where HTML snapshots of your pages are kept. To tell search engines to look for these snapshots you need to add the fragment meta tag to the head section of your views (maybe at
views/index.ejs if you're using ejs as the view engine):
This method works both with HTML5 pushState URLs as well as Hashbang URLs (/some/action#!route)
The MIT License (MIT)
Copyright (c) 2013 SEO.js. http://getseojs.com/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.