nails-web

0.0.3 • Public • Published
Nails Framework

nails-web

This plugin allows you to create web services with nails-framework.

Express

Adds app.web, a bootstrapped Express app with some additional tools to ease integration with nails plugins.

Middleware Groups

Middleware is grouped together and loaded in the following order:

  • first (empty)
  • request (initial request, add headers etc)
  • middleware (bodyParser, cookieParser, etc)
  • router (express router)
  • static (static file server)
  • error (unhandled errors - 404 page)
  • last (empty)

Middleware can be added to the beginning or end of any group:

app.web.useBefore('router', function(req, res, next) {
  console.log('Runs before the express.router');
});
 
app.web.useAfter('static', function(req, res, next) {
  console.log('Runs after the static middleware');
});

Licence

The MIT License (MIT)

Copyright (c) 2013 James Wyse james@jameswyse.net

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.

Readme

Keywords

none

Package Sidebar

Install

npm i nails-web

Weekly Downloads

0

Version

0.0.3

License

none

Last publish

Collaborators

  • jameswyse