( app: WebAssetRouteHost, assetsDir: string, )
| 12 | } |
| 13 | |
| 14 | export async function registerWebAssetRoutes( |
| 15 | app: WebAssetRouteHost, |
| 16 | assetsDir: string, |
| 17 | ): Promise<void> { |
| 18 | await assertWebAssets(assetsDir); |
| 19 | |
| 20 | app.get('/', async (req, reply) => serveWebAsset(req, reply, assetsDir)); |
| 21 | app.get('/*', async (req, reply) => serveWebAsset(req, reply, assetsDir)); |
| 22 | } |
| 23 | |
| 24 | async function assertWebAssets(assetsDir: string): Promise<void> { |
| 25 | try { |
no test coverage detected