Skip to content

Instantly share code, notes, and snippets.

@darrenderidder
Last active December 11, 2015 09:48
Show Gist options
  • Save darrenderidder/4582552 to your computer and use it in GitHub Desktop.
Save darrenderidder/4582552 to your computer and use it in GitHub Desktop.
Basic route definition in Express.JS
app.get('/arcticle', function (req, res){
// get article from somewhere
res.send(article);
});
app.post('/article', function (req, res) {
// create article
});
app.put('/article', function (req, res) {
// update article
});
app.delete('/article', function (req, res) {
// delete article
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment