Make apply module function async

This will allow us to support async module loading required for ES
modules support.

GitOrigin-RevId: bfd925c94ca3b6df8f75f704e21164a546973f5f
This commit is contained in:
andrew rumble 2024-10-02 16:00:22 +01:00 committed by Copybot
parent 2f96ef11f9
commit 46317a9b9c

View file

@ -68,7 +68,7 @@ const loadModules = _.memoize(loadModulesImpl)
async function applyRouter(webRouter, privateApiRouter, publicApiRouter) {
for (const module of await modules()) {
if (module.router && module.router.apply) {
module.router.apply(webRouter, privateApiRouter, publicApiRouter)
await module.router.apply(webRouter, privateApiRouter, publicApiRouter)
}
}
}