This commit is contained in:
2026-03-18 17:37:24 +01:00
parent f6db3ab866
commit eec0df83cd
79 changed files with 2333 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import deserializeQuery from "./deserialize-query";
export default async function grabRouteParams({ req, }) {
const url = new URL(req.url);
const query = deserializeQuery(Object.fromEntries(url.searchParams));
const body = await (async () => {
try {
return req.method == "GET" ? undefined : await req.json();
}
catch (error) {
return {};
}
})();
const routeParams = {
req,
url,
query,
body,
server: global.SERVER,
};
return routeParams;
}