public
Last active

Using restify with connect

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// Restify server config here
var server = restify.createServer({
name: 'restify-test',
version: '1.0.0',
});
 
// ...
 
// Connect config here
var connectApp = connect()
.use(connect.logger())
.use(connect.bodyParser())
.use(connect.query())
.use(connect.cookieParser())
// And this is where the magic happens
.use("/api", function (req, res) {
server.server.emit('request', req, res);
});
 
connectApp.listen(8080);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.