koajs / router

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

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

Closed urobot2011 closed 10 months ago

urobot2011 commented 10 months 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')));.