Unverified Commit 33df8e6f authored by Noob Tsai's avatar Noob Tsai Committed by GitHub

Update Koa Router Example (#19272)

The `custom-server-koa` example is not working in the latest koa-router, so I made some changes mentioned in #9705.

Also update Koa.js to 2.13.0.
parent 3478e1d0
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
"start": "cross-env NODE_ENV=production node server.js" "start": "cross-env NODE_ENV=production node server.js"
}, },
"dependencies": { "dependencies": {
"@koa/router": "^8.0.7", "@koa/router": "^10.0.0",
"cross-env": "^5.2.0", "cross-env": "^5.2.0",
"koa": "^2.0.1", "koa": "^2.13.0",
"next": "latest", "next": "latest",
"react": "^16.7.0", "react": "^16.7.0",
"react-dom": "^16.7.0" "react-dom": "^16.7.0"
......
...@@ -21,7 +21,7 @@ app.prepare().then(() => { ...@@ -21,7 +21,7 @@ app.prepare().then(() => {
ctx.respond = false ctx.respond = false
}) })
router.all('*', async (ctx) => { router.all('(.*)', async (ctx) => {
await handle(ctx.req, ctx.res) await handle(ctx.req, ctx.res)
ctx.respond = false ctx.respond = false
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment