Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Small common methods commonly used for exposed APIs
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.gitignore
.jshintrc
README.md
changelog.md
index.js
package.json

README.md

Express/Connect util Middleware

Small common methods commonly used for exposed APIs

Current Features

  • status: Respond 200 at the /status url and wont write to logs
  • logger: Write logs depending on the enviroment
  • allowCrossDomain: Allow Cross Domain Requests
  • signResponse: Adds the 'Built-By' Header with the value passed

Usage

npm install https://github.com/Twnel/Util-Midleware/tarball/master

_ at your express app ex. app.js_

var express = require('express') , http = require('http') , middleware = require('util-express-middleware')

var app = express();

app.use(middleware.status()); app.use(middleware.allowCrossDomain()); app.use(middleware.logger(process.env.NODE_ENV)); app.use(middleware.signResponse('Twnel Inc.'));

http.createServer(app).listen(3000);;

Something went wrong with that request. Please try again.