Skip to content

Commit 858d370

Browse files
author
edgeonecc
committed
Update build script in package.json to copy package.json to functions and out directories
1 parent e4617ed commit 858d370

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

functions/helloworld/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
7-
"build": "next build",
7+
"build": "next build && cp -r package.json functions out",
88
"start": "next start",
99
"lint": "next lint"
1010
},

0 commit comments

Comments
 (0)