(assetsDir: string)
| 22 | } |
| 23 | |
| 24 | async function assertWebAssets(assetsDir: string): Promise<void> { |
| 25 | try { |
| 26 | const info = await stat(join(assetsDir, 'index.html')); |
| 27 | if (!info.isFile()) { |
| 28 | throw new Error('index.html is not a file'); |
| 29 | } |
| 30 | } catch { |
| 31 | throw new Error( |
| 32 | `Kimi web assets were not found at ${assetsDir}. Run the package build before starting the server.`, |
| 33 | ); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | async function serveWebAsset( |
| 38 | req: FastifyRequest, |
no test coverage detected