Skip to content

Commit d00d0d9

Browse files
committed
update app.js
1 parent 1ef684a commit d00d0d9

File tree

1 file changed

+5
-1
lines changed
  • samples/node/web/vue/vue-todo

1 file changed

+5
-1
lines changed

samples/node/web/vue/vue-todo/app.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ app.use(staticFiles('/static/', __dirname + '/static'));
2222

2323
// redirect to /static/index.html:
2424
app.use(async (ctx, next) => {
25-
ctx.response.redirect('/static/index.html');
25+
if (ctx.request.path === '/') {
26+
ctx.response.redirect('/static/index.html');
27+
} else {
28+
await next();
29+
}
2630
});
2731

2832
app.listen(3000);

0 commit comments

Comments
 (0)