add example apidoc comments, add notFound middleware

This commit is contained in:
Matteo Pagliazzi
2015-11-17 16:48:50 +01:00
parent 61948e1ca5
commit aa1b046cf2
9 changed files with 102 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ import analytics from './analytics';
import errorHandler from './errorHandler';
import bodyParser from 'body-parser';
import routes from '../../libs/api-v3/setupRoutes';
import notFoundHandler from './notFound';
export default function attachMiddlewares (app) {
// Parse query parameters and json bodies
@@ -15,6 +16,7 @@ export default function attachMiddlewares (app) {
app.use(analytics);
app.use(routes);
app.use(notFoundHandler);
// Error handler middleware, define as the last one
app.use(errorHandler);