koajs / router

Router middleware for Koa. Maintained by @forwardemail and @ladjs.
MIT License
871 stars 176 forks source link

[fix] router.use doesn't work with middleware. #175

Closed urobot2011 closed 1 year ago

urobot2011 commented 1 year ago

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')); or router.use('/', mount('/static', serve(__dirname + '/static')));.