From 07254a59380a2ec3f5b3383d377f20c486af8b30 Mon Sep 17 00:00:00 2001 From: productdevbook Date: Thu, 5 Dec 2024 20:39:43 +0300 Subject: [PATCH] fix: worker init --- src/runtime/handlers/dashboard.ts | 9 ++------- src/runtime/templates/{dashboard.html => dashboard.ts} | 9 +++++---- 2 files changed, 7 insertions(+), 11 deletions(-) rename src/runtime/templates/{dashboard.html => dashboard.ts} (98%) diff --git a/src/runtime/handlers/dashboard.ts b/src/runtime/handlers/dashboard.ts index c406fe6..926e045 100644 --- a/src/runtime/handlers/dashboard.ts +++ b/src/runtime/handlers/dashboard.ts @@ -1,12 +1,7 @@ -import { readFileSync } from 'node:fs' -import { resolve } from 'node:path' -import { fileURLToPath } from 'node:url' +import { html } from '../templates/dashboard' export function createDashboardHandler() { - const __dirname = fileURLToPath(new URL('.', import.meta.url)) - const template = readFileSync(resolve(__dirname, '../templates/dashboard.html'), 'utf-8') - return async () => { - return template + return html } } diff --git a/src/runtime/templates/dashboard.html b/src/runtime/templates/dashboard.ts similarity index 98% rename from src/runtime/templates/dashboard.html rename to src/runtime/templates/dashboard.ts index ac87afc..4b02bf9 100644 --- a/src/runtime/templates/dashboard.html +++ b/src/runtime/templates/dashboard.ts @@ -1,4 +1,4 @@ - +export const html = ` @@ -217,8 +217,8 @@

Recent RequestsRecent Requests - \ No newline at end of file + +`