We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5ab906 commit 14003f5Copy full SHA for 14003f5
app.js
@@ -24,7 +24,7 @@ app.use(express.static(path.join(__dirname, 'public')));
24
25
// set response header
26
app.use(function(req, res, next) {
27
- if (req.path.endsWith('.json')) {
+ if (path.extname(req.path) == '.json') {
28
res.setHeader('Content-Type', 'application/json');
29
}
30
next();
0 commit comments