Skip to content

Instantly share code, notes, and snippets.

@brianflurry
Created October 2, 2012 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianflurry/3821649 to your computer and use it in GitHub Desktop.
Save brianflurry/3821649 to your computer and use it in GitHub Desktop.
Start Server
exports.StartServer = function() {
var restify = require('restify');
function respond(req, res, next) {
res.contentType = 'application/json';
res.send({ code: 200, message: 'hello ' + req.params.name });
res.end();
}
var server = restify.createServer();
server.get('/hello/:name', respond);
server.listen(8080, function() {
console.log('%s listening at %s', server.name, server.url);
});
};
@dweinstein
Copy link

you're missing a call to next() I believe after line 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment