connect-s4a

SEO4Ajax middleware for Connect.

npm install connect-s4a
5 downloads in the last day
34 downloads in the last week
58 downloads in the last month

Connect-s4a

Connect-s4a is a middleware for Connect framework. It provides a easy way to proxify GET requests from non-js clients to SEO4Ajax.

Usage

This middleware must be on the first called.

With connect :

var connect_s4a = require('connect-s4a');
var token = "your site token on SEO4Ajax";
var connect = require('connect');
var app = connect();
app.use(connect_s4a(token));
app.use(function(req, res){
    res.end('hello world\n');
});
app.listen(3000);

With express :

var connect_s4a = require('connect-s4a');
var token = "your site token on SEO4Ajax";
var express = require('express');
var app = express.createServer();
app.use(connect-s4a(token));
app.get('/', function(req, res){
    res.send('hello world');
});
app.listen(3000);

Connect-s4a take only one parameter, the token of the site on SE04Ajax.

Installation

Via npm :

$ npm install connect-s4a

How it works

This module checks the presence of the escaped_fragment query parameter. If this parameter is present, it requests the snapshot on SEO4Ajax and responds to the initial request with this snapshot.

Requirements

  • node (>= 0.10.0)
  • connect (>= 0.2.4) or express (>= 0.3.0)

Tests

node tests/run.js

License

(The MIT License)

Copyright (c) 2013 Lormeau Gildas, Le Saout Yannick

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.

npm loves you