Closed ichn-hu closed 4 years ago
So you get the result you are expecting at the /good
endpoint but not the /cat/good
endpoint?
Please, provide a minimal repository which reproduces your issue.
So you get the result you are expecting at the
/good
endpoint but not the/cat/good
endpoint?
I am expecting /cat/good
, but get /good
.
Please, provide a minimal repository which reproduces your issue.
Sure, please take a look, https://github.com/ichn-hu/nestjs-route-bug-reproduce
https://github.com/ichn-hu/nestjs-route-bug-reproduce/blob/master/src/app.controller.ts
This is the only modified file from nest n proj
, I didn't do anything with other files. I was working on another project using nestjs but found the route not working and could reproduce it from the bare bone nest n proj
.
My fault, it is actually routed to /good/cat
... The logged information is misleading, it reads
[Nest] 13871 - 02/11/2020, 9:42:45 AM [NestFactory] Starting Nest application...
[Nest] 13871 - 02/11/2020, 9:42:45 AM [InstanceLoader] AppModule dependencies initialized +32ms
[Nest] 13871 - 02/11/2020, 9:42:45 AM [RoutesResolver] AppController {/cat}: +11ms
[Nest] 13871 - 02/11/2020, 9:42:45 AM [RouterExplorer] Mapped {/good, GET} route +3ms
[Nest] 13871 - 02/11/2020, 9:42:45 AM [NestApplication] Nest application successfully started +2ms
When I saw Mapped {/good, GET}
, I thought it's routed to /good
, but it is actually /cat/good
as expected.
Perhaps this issue can be useful from a starter's perspective, and I would suggest some change here but since my problem is solved, I am closing it.
Thanks @JustinR93 and @kamilmysliwiec for comment.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug Report
Current behavior
Input Code
Use
nest n proj
to create a blank project and changesrc/app.controller.ts
into (just add prefixes)Expected behavior
getHello
routed to/cat/good
, however it is routed to/good
and thecat
prefix is ignored.Environment