Skip to content

Instantly share code, notes, and snippets.

@searls
Created March 21, 2014 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searls/9688695 to your computer and use it in GitHub Desktop.
Save searls/9688695 to your computer and use it in GitHub Desktop.
server-route to read json from files. config/server.js
fs = require('fs')
module.exports = {
drawRoutes: function(app) {
app.get('/some-file', function(req, res){
res.json(JSON.parse(fs.readFileSync("config/spec.json").toString()));
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment