We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0994fa commit c3c798dCopy full SHA for c3c798d
api/v1/index.ts
@@ -1,15 +1,13 @@
1
-import fetchContent from './_utils';
2
-
3
-export const config = {
4
- runtime: 'edge',
5
-};
+import type { VercelRequest, VercelResponse } from '@vercel/node';
6
7
-export default async (req: Request) => {
8
- if (req.method !== 'POST') return new Response('Method Not Allowed', { status: 405 });
+import fetchContent from './_utils';
9
10
- const args = (await req.json()) as { url: string };
+export default async function handler(req: VercelRequest, res: VercelResponse) {
+ if (req.method !== 'POST') {
+ res.status(405);
+ }
11
12
- const result = await fetchContent(args);
+ const result = await fetchContent(req.body);
13
14
- return new Response(JSON.stringify(result));
15
+ res.send(result);
+}
0 commit comments