wip fix prasi api

This commit is contained in:
Rizky
2024-02-22 04:55:01 +07:00
parent c916e47150
commit 1b77a5851d
8 changed files with 169 additions and 24 deletions
+2
View File
@@ -27,6 +27,7 @@ export const createServer = async () => {
const route = {
url: api._.url,
args,
raw: !!api._.raw,
fn: api._.api,
path: importPath.substring((root || path).length + 1),
};
@@ -66,6 +67,7 @@ export const createServer = async () => {
g.server = Bun.serve({
port: g.port,
maxRequestBodySize: 1024 * 1024 * 128,
async fetch(req) {
const url = new URL(req.url);
+1 -1
View File
@@ -20,7 +20,7 @@ export const serveAPI = async (url: URL, req: Request) => {
return params[e];
});
if (req.method !== "GET") {
if (req.method !== "GET" && !found.raw) {
if (!req.headers.get("content-type")?.startsWith("multipart/form-data")) {
try {
const json = await req.json();