refactor(server): moved the server files outside the src to improve static files

This commit is contained in:
2025-03-01 15:23:42 -06:00
parent d3acdfb481
commit 89a2b3ea9e
28 changed files with 4592 additions and 2253 deletions

View File

@@ -0,0 +1,19 @@
import type {Context} from "hono";
export const ocmeService = async (c: Context) => {
const url = new URL(c.req.url);
const ocmeUrl = `http://localhost:${process.env.OCME_PORT}${url.pathname.replace("/ocme", "")}`;
console.log(ocmeUrl);
const ocmeResponse = await fetch(ocmeUrl, {
method: c.req.method,
headers: c.req.raw.headers,
body: c.req.method !== "GET" && c.req.method !== "HEAD" ? await c.req.text() : undefined,
});
return new Response(ocmeResponse.body, {
status: ocmeResponse.status,
headers: ocmeResponse.headers,
});
};