I Have the following code:
...
var servceStatic = require("serve-static");
var app = express();
app.use(express.compress());
app.use(servceStatic('static'));
...
Somehow it manages to serve all kind of files except those that end with ".json". Why is this?
you don´t need this module serve-static, because it is build in in express:
create a public folder and than just add this line to your code after your instantiation of express:
var path = require('path');
app.use(express.static(path.join(__dirname, 'public')));
This should hand out all your files including the JSON files.