This commit is contained in:
Rizky 2024-02-07 11:00:20 +07:00
parent 9b9e43baaf
commit 42c1793880
2 changed files with 24 additions and 5 deletions

View File

@ -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";
const pathname = req.params["*"];
if (pathname === "index.html" || pathname === "_") {
return new Response(
`\
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link rel="stylesheet" href="https://prasi.app/index.css">
</head>
<body class="flex-col flex-1 w-full min-h-screen flex opacity-0">
<div id="root"></div>
<script src="/deploy/main.js" type="module"></script>
</body>
</html>`,
{ headers: { "content-type": "text/html" } }
);
}
},
};

View File

@ -33,7 +33,6 @@ export const serveAPI = {
found = null;
}
}
console.log(found?.fn.toString());
if (found) {
const params = { ...found.params };