nestia icon indicating copy to clipboard operation
nestia copied to clipboard

Problems that are always registered at the highest level when registering through RouterModule

Open hmmhmmhm opened this issue 2 years ago • 1 comments

스크린샷 2022-04-25 오전 11 23 46 스크린샷 2022-04-25 오전 11 26 21

When registering through RouterModule It would be good to use path information in nestia.

hmmhmmhm avatar Apr 25 '22 02:04 hmmhmmhm

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.

samchon avatar May 07 '22 10:05 samchon

I don't think you can go around this one, you have to analyze the module tree (including RouterModule) the same way Nest does.

TheYarin avatar Feb 14 '23 11:02 TheYarin

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;

samchon avatar Oct 19 '23 07:10 samchon