|
@@ -946,8 +946,8 @@ if (Meteor.isServer) {
|
|
if (Meteor.isServer) {
|
|
if (Meteor.isServer) {
|
|
// Middleware which checks that API is enabled.
|
|
// Middleware which checks that API is enabled.
|
|
JsonRoutes.Middleware.use(function(req, res, next) {
|
|
JsonRoutes.Middleware.use(function(req, res, next) {
|
|
- const api = req.url.search('api');
|
|
|
|
- if ((api === 1 && process.env.WITH_API === 'true') || api === -1) {
|
|
|
|
|
|
+ const api = req.url.startsWith('/api');
|
|
|
|
+ if ((api === true && process.env.WITH_API === 'true') || api === false) {
|
|
return next();
|
|
return next();
|
|
} else {
|
|
} else {
|
|
res.writeHead(301, { Location: '/' });
|
|
res.writeHead(301, { Location: '/' });
|