This commit is contained in:
Rizky
2024-03-07 11:09:44 +07:00
parent a9fbf2d3ca
commit 9ea7e373d8
5 changed files with 51 additions and 57 deletions
+2 -12
View File
@@ -59,12 +59,6 @@ export const createServer = async () => {
await scan(dir(`app/srv/api`));
await scan(dir(`pkgs/api`));
g.createServer = (arg) => {
return async (site_id: string) => {
return arg;
};
};
g.server = Bun.serve({
port: g.port,
maxRequestBodySize: 1024 * 1024 * 128,
@@ -131,12 +125,8 @@ export const createServer = async () => {
(await existsAsync(dir(`app/web/server/index.js`)))
) {
const res = require(dir(`app/web/server/index.js`));
if (res && res.server) {
if (typeof res.server === "function") {
g.deploy.server = await res.server();
} else {
g.deploy.server = res.server;
}
if (res && typeof res.server === 'object') {
g.deploy.server = res.server;
}
}
if (g.deploy.server && g.deploy.index) {
-2
View File
@@ -1,7 +1,5 @@
import mime from "mime";
export const serveWeb = async (arg: { pathname: string; content: string }) => {
const type = mime.getType(arg.pathname);