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 e4617ed commit 858d370Copy full SHA for 858d370
functions/helloworld/index.ts
@@ -0,0 +1,16 @@
1
+export function onRequest(context: {
2
+ request: Request;
3
+ env: { [key: string]: string };
4
+ params: { [key: string]: string };
5
+}) {
6
+ const res = JSON.stringify({
7
+ code: 0,
8
+ message: "Hello World",
9
+ });
10
+
11
+ return new Response(res, {
12
+ headers: {
13
+ "content-type": "application/json",
14
+ },
15
16
+}
package.json
@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
- "build": "next build",
+ "build": "next build && cp -r package.json functions out",
"start": "next start",
"lint": "next lint"
},
0 commit comments