Last active
May 20, 2017 22:28
-
-
Save morganney/9015641 to your computer and use it in GitHub Desktop.
Example starting restbus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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