Skip to content

Node.js based forum software built for the modern web

fixing request to /api not returning api result

Julian Lam74e552449271
diff --git a/src/routes/index.js b/src/routes/index.js
index e53ebbe275..e843175098 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -160,7 +160,7 @@ module.exports = function(app, middleware) {
app.render.apply(app, arguments);
};
- app.all(relativePath + '/api/*', middleware.updateLastOnlineTime, middleware.prepareAPI);
+ app.all(relativePath + '/api/?*', middleware.updateLastOnlineTime, middleware.prepareAPI);
app.all(relativePath + '/api/admin/*', middleware.admin.isAdmin, middleware.prepareAPI);
app.all(relativePath + '/admin/*', middleware.admin.isAdmin);
app.get(relativePath + '/admin', middleware.admin.isAdmin);
@@ -247,4 +247,4 @@ function catch404(req, res, next) {
} else {
res.type('txt').send('Not found');
}
-}
\ No newline at end of file
+}