to-middleware
v1.0.0
Published
Turn from server to connect/express middleware.
Downloads
4
Maintainers
Readme
to-middleware
Turn from server to connect/express middleware.
Install
$ npm install to-middleware
Usage
var middleware = require('to-middleware');
var express = require('express');
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
});
var app = express();
app.use('/hello', middleware(server));
yields:
$ curl http://localhost:3000/hello
Hello World
License
MIT