Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Using restify with connect

View gist:2140974
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);

:+1:

Really helped some standalone development of a feature! (Mocked out a backend via grunt-contrib-connect + this middleware)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.