Skip to content

Instantly share code, notes, and snippets.

@Hogent
Created May 15, 2013 11:57
Show Gist options
  • Save Hogent/5583458 to your computer and use it in GitHub Desktop.
Save Hogent/5583458 to your computer and use it in GitHub Desktop.
express example
var express = require('express');
var app = express();
app.get('/notes', function(req, res) {
res.send([{note:'note1'}, {note:'note2'}, {note:'note3'}]);
});
app.get('/notes/:id', function(req, res) {
res.send({id:req.params.id, title: "note title", description: "note description"});
});
app.listen(3000);
console.log('Listening on port 3000...');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment