wip api-v3: add error handler middleware and custom error classes

This commit is contained in:
Matteo Pagliazzi
2015-11-03 13:35:32 +01:00
parent b21df9edb3
commit 4322b8c3dc
4 changed files with 98 additions and 0 deletions

View File

@@ -104,6 +104,9 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
// Matches all requests going to /api/v3
app.all('/api/v3', newApp);
// Mount middlewares for the new app
require('./middlewares/api-v3/index')(newApp);
//require('./middlewares/apiThrottle')(oldApp);
oldApp.use(require('./middlewares/domain')(server,mongoose));
if (!isProd && !DISABLE_LOGGING) oldApp.use(require('morgan')("dev"));