Add dist
This commit is contained in:
Vendored
+21
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user