Refactors routers

This commit is contained in:
Florent Vilmart
2016-02-19 23:47:44 -05:00
parent 067946c66c
commit 3c4d5159b4
14 changed files with 281 additions and 271 deletions

View File

@@ -50,14 +50,12 @@ export class InstallationsRouter extends ClassesRouter {
return super.handleDelete(req);
}
getExpressRouter() {
let router = new PromiseRouter();
router.route('GET','/installations', req => { return this.handleFind(req); });
router.route('GET','/installations/:objectId', req => { return this.handleGet(req); });
router.route('POST','/installations', req => { return this.handleCreate(req); });
router.route('PUT','/installations/:objectId', req => { return this.handleUpdate(req); });
router.route('DELETE','/installations/:objectId', req => { return this.handleDelete(req); });
return router;
mountRoutes() {
this.route('GET','/installations', req => { return this.handleFind(req); });
this.route('GET','/installations/:objectId', req => { return this.handleGet(req); });
this.route('POST','/installations', req => { return this.handleCreate(req); });
this.route('PUT','/installations/:objectId', req => { return this.handleUpdate(req); });
this.route('DELETE','/installations/:objectId', req => { return this.handleDelete(req); });
}
}