Skip to content

Instantly share code, notes, and snippets.

@morganney
Last active May 20, 2017 22:28
Show Gist options
  • Select an option

  • Save morganney/9015641 to your computer and use it in GitHub Desktop.

Select an option

Save morganney/9015641 to your computer and use it in GitHub Desktop.
Example starting restbus.
// Standalone server
require('restbus').listen(3000, function() {
console.log('restbus is now listening on port 3000');
});
// Embedded
var app = require('express');
var restbus = require('restbus');
// (As express middleware)
app.use('/restbus', restbus.middleware());
app.listen(3000);
// (As a separate server)
app.listen(3000, function() {
restbus.listen(3001, function() {
console.log('app listening on 3000, restbus listening on 3001');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment