From 42c1793880949de31f2188fecce71180296b87c9 Mon Sep 17 00:00:00 2001 From: Rizky Date: Wed, 7 Feb 2024 11:00:20 +0700 Subject: [PATCH] wip fix --- app/srv/api/deploy.ts | 28 ++++++++++++++++++++++++---- pkgs/core/server/serve-api.ts | 1 - 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/srv/api/deploy.ts b/app/srv/api/deploy.ts index 87ead5d9..8ddc3f01 100644 --- a/app/srv/api/deploy.ts +++ b/app/srv/api/deploy.ts @@ -1,10 +1,30 @@ +import { dir } from "dir"; import { apiContext } from "service-srv"; export const _ = { url: "/deploy/**", async api() { const { req, res } = apiContext(this); - return "rukausfb"; - }, -}; - \ No newline at end of file + + const pathname = req.params["*"]; + if (pathname === "index.html" || pathname === "_") { + return new Response( + `\ + + + + + + + + + +
+ + +`, + { headers: { "content-type": "text/html" } } + ); + } + }, +}; diff --git a/pkgs/core/server/serve-api.ts b/pkgs/core/server/serve-api.ts index 0f0542a7..6bf1b72f 100644 --- a/pkgs/core/server/serve-api.ts +++ b/pkgs/core/server/serve-api.ts @@ -33,7 +33,6 @@ export const serveAPI = { found = null; } } - console.log(found?.fn.toString()); if (found) { const params = { ...found.params };