Created
October 21, 2014 20:26
-
-
Save joshbedo/f12b1095be8f03708eb8 to your computer and use it in GitHub Desktop.
express example
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
var express = require('express'), | |
bodyParser = require('body-parser'), | |
app = express(), | |
port = process.env.PORT || 1337; | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); | |
var router = express.Router(); | |
router.get('/', function(req, res) { | |
res.json({ message: 'Welcome to the home page!' }); | |
}); | |
// Register all our api routes | |
app.use('/api', router); | |
app.listen(port); | |
console.log('Admin UI API endpoints have started on port ' + port); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment