Closed urobot2011 closed 1 year ago
Node.js version: v20.5.0
OS version: Docker Debian 11
Description: router.use doesn't work.
My code: https://github.com/urobot2011/Koa-router-use-test/
It works: app.use(mount('/static', serve(__dirname + '/static'))); But this doesn't work: router.use('/static', serve(__dirname + '/static')); or router.use('/', mount('/static', serve(__dirname + '/static')));.
app.use(mount('/static', serve(__dirname + '/static')));
router.use('/static', serve(__dirname + '/static'));
router.use('/', mount('/static', serve(__dirname + '/static')));
Describe the bug
Node.js version: v20.5.0
OS version: Docker Debian 11
Description: router.use doesn't work.
Actual behavior
My code: https://github.com/urobot2011/Koa-router-use-test/
It works:
app.use(mount('/static', serve(__dirname + '/static')));
But this doesn't work:router.use('/static', serve(__dirname + '/static'));
orrouter.use('/', mount('/static', serve(__dirname + '/static')));
.