Skip to content

Commit 3c60ed6

Browse files
committed
fix: asset prefix
1 parent 03e3aff commit 3c60ed6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"scripts": {
55
"dev": "nodemon",
6-
"build": "next build && tsc --project tsconfig.server.json",
6+
"build": "cross-env NODE_ENV=production next build && tsc --project tsconfig.server.json",
77
"start": "cross-env NODE_ENV=production node ./dist/index.js",
88
"deploy": "sls deploy"
99
},

server/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ async function startServer() {
4242
await app.prepare();
4343

4444
const server = Express();
45-
app.setAssetPrefix(process.env.STATIC_PATH);
4645
server.use(Express.static(join(__dirname, '../public/static')));
4746

4847
server.get('/', async (req, res) => {

serverless.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ inputs:
1010
hook: npm run build
1111
exclude:
1212
- .env
13+
- '.next/cache/**'
1314
region: ap-guangzhou
1415
runtime: Nodejs10.15
1516
functionName: serverless-cnode
17+
functionConf:
18+
timeout: 10
1619
apigatewayConf:
1720
protocols:
1821
- http

0 commit comments

Comments
 (0)