diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts index 69a7d86..2818682 100644 --- a/src/index.ts +++ b/src/index.ts @@ -129,7 +129,7 @@ function parseIfModifiedSinceHeader(header: string | null): number { return header ? new Date(header).getTime() + 999 : 0; } -Bun.serve({ +const metricsServer = Bun.serve({ port: 9091, fetch: async function (request) { const pathname = new URL(request.url).pathname; @@ -142,7 +142,11 @@ Bun.serve({ }, }); -export default { +console.info( + `Serving metrics on http://${metricsServer.hostname}:${metricsServer.port}/metrics`, +); + +const server = Bun.serve({ fetch: async function (request) { const pathname = new URL(request.url).pathname; const file = files.get(pathname); @@ -183,4 +187,6 @@ export default { } return serveFile(file); }, -} satisfies Serve; +}); + +console.info(`Serving website on http://${server.hostname}:${server.port}/`); |