Skip to content

Instantly share code, notes, and snippets.

@coderarity
Forked from anonymous/gist:4576233
Last active December 11, 2015 08:58
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 coderarity/4576240 to your computer and use it in GitHub Desktop.
Save coderarity/4576240 to your computer and use it in GitHub Desktop.
var express = require('express'),
wine = require('./routes/wines');
var app = express();
app.configure(function () {
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
app.use(express.bodyParser());
app.use(express.static(__dirname));
});
app.get('/wines', wine.findAll);
app.get('/wines/:id', wine.findById);
app.post('/wines', wine.addWine);
app.put('/wines/:id', wine.updateWine);
app.delete('/wines/:id', wine.deleteWine);
app.listen(8080);
console.log('Listening on port 8080...');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment