Closed
Description
Hi, I have one Controller which have 2 method like below
import { JsonController, Get } from 'routing-controllers'
@JsonController('/api')
export class APIController {
@Get('/user')
public getByUser() {
console.log('output2')
return Promise.resolve({ say: 'user' })
}
@Get('/:id')
public getById() {
console.log('output1')
return Promise.resolve({ say: 'hello1' })
}
}
I run server and then send http request in path '/user'. The result in console log print follow below
output1
output2
and I receive response as json { say: 'user' }. I take a look at source code and found that after action was called, routing-controller call next method which I suspect it is the reason why 2 action which match path url call. I test by insert after after middleware that didn't call next. The result is only getByUser was called. Is this intend behavior? It use invoke only getByUser, is't it?