Skip to content

Instantly share code, notes, and snippets.

@jreyes33
Created January 9, 2014 04:22
Embed
What would you like to do?
var express = require('express');
var fs = require('fs');
var app = express();
app.get('*', function(req, res) {
fs.readFile('public' + req.originalUrl, function(err, data) {
if (err) {
res.send('File not found ' + req.originalUrl);
} else {
res.contentType('application/json');
res.send(data);
}
res.end();
});
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment