Skip to content

Instantly share code, notes, and snippets.

@jreyes33
Created January 9, 2014 04:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreyes33/8329370 to your computer and use it in GitHub Desktop.
Save jreyes33/8329370 to your computer and use it in GitHub Desktop.
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