Skip to content

Instantly share code, notes, and snippets.

@olegp
Last active August 29, 2015 14:06
Show Gist options
  • Save olegp/f9705c633a03884cd672 to your computer and use it in GitHub Desktop.
Save olegp/f9705c633a03884cd672 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
var messages = [
{ date: new Date(), text: "Hello World" }
];
app.use('/', express.static('./'));
app.get('/api/', function(req, res){
res.json(messages);
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment