Make routes wait until all asynchronous stuff are done

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2022-03-11 09:11:11 +02:00
1 parent afa9c10969
commit d099256c9a
1 file changed
+2 -2
+2 -2
View File
@@ -46,8 +46,8 @@ export class Router {
constructor(routes: Route[]) {
routes.forEach(route => {
this.router.add({ method: route.method, path: route.path }, (request: LensApiRequest) => {
route.handler(request);
this.router.add({ method: route.method, path: route.path }, async (request: LensApiRequest) => {
await route.handler(request);
});
});
}