mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make routes wait until all asynchronous stuff are done
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
afa9c10969
commit
d099256c9a
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user