about summary refs log tree commit diff stats
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts12
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}/`);