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[]) {
|
constructor(routes: Route[]) {
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
this.router.add({ method: route.method, path: route.path }, (request: LensApiRequest) => {
|
this.router.add({ method: route.method, path: route.path }, async (request: LensApiRequest) => {
|
||||||
route.handler(request);
|
await route.handler(request);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user