-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
if you have a controller that handles wildcard path, url includes /trpc/* fallbacks to that route.
// src/trpc/trpc.module.ts
@Module({
imports: [
TRPCModule.forRoot({
autoSchemaFile: 'src/trpc/@generated',
}),
],
})
export class TrpcModule {}
// src/app.controller.ts
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
// this works
@Get('/hello')
getHello(): string {
return this.appService.getHello();
}
@All('*')
all() {
return '*';
}
}curl http://localhost:3000/defaultRouter.HomeScreenQuery
-> *
using middleware or router of underlying framework directly has no issues with nest's wildcard
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
// this works
app.use('/use', (req, res, next) => {
res.send('/use');
});
// this works as well
const srv = app.getHttpAdapter().getInstance();
srv.get('/get', (req, res) => {
res.send('/get');
});
await app.listen(3000);
}any workarounds would be much appreciated!
Metadata
Metadata
Assignees
Labels
No labels