nestia
nestia copied to clipboard
Problems that are always registered at the highest level when registering through RouterModule
When registering through RouterModule It would be good to use path information in nestia.
As the @Module
decorator function comes with the main program who really opens the backend server, it seems dangerous for the nestia to analyze it in the runtime level.
If someone has a good idea to solve this issue, please help me.
I don't think you can go around this one, you have to analyze the module tree (including RouterModule) the same way Nest does.
https://nestia.io/docs/sdk/sdk/#configuration
@hmmhmmhm, @TheYarin Upgrade to v2.3, then you can do it.
import { INestiaConfig } from "@nestia/sdk";
import { Module, VersioningType } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
const NESTIA_CONFIG: INestiaConfig = {
input: async () => {
const app = await NestFactory.create(MyModule);
app.setGlobalPrefix("api");
app.enableVersioning({
type: VersioningType.URI,
prefix: "v",
});
return app;
},
output: "src/api",
e2e: "src/test",
swagger: {
output: "swagger.json",
security: {
bearer: {
type: "apiKey",
},
},
},
};
export default NESTIA_CONFIG;