Created
November 26, 2013 19:23
-
-
Save vdurmont/7664504 to your computer and use it in GitHub Desktop.
main file for a basic express.js API
This file contains 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'); | |
var routes = require('./routes.js'); | |
var app = express(); | |
app.use(express.bodyParser()); | |
app.get('/', routes.getAll); | |
app.post('/', routes.create); | |
app.get('/:id', routes.get); | |
app.put('/:id', routes.update); | |
app.del('/:id', routes.del); | |
app.listen(3333); | |
console.log('Running on port 3333!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment