[WIP] "exclude" option not considered while using app.setGlobalPrefix(..) in nestia.config.ts
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original issue description:
Summary
When calling the
app.setGlobalPrefix(...)function innestia.config.ts, it appears that the paths mentioned in the "exclude" option are also getting the global prefix (see example below). The correct behavior is that such paths should be excluded from the global prefix. When the SDK generates the fetch function for such routes, it should not apply the global prefix to their paths.
SDK Version: "@nestia/sdk": "^2.4.5",
Expected behavior: The sdk should not apply the global prefix to the paths included in the "exclude" option.
Actual behavior: The paths included in the "exclude" option should be ignored while setting the global prefix, but they are not being excluded in the generated sdk route.
Code where the bug is occuring:
import { INestiaConfig } from '@nestia/sdk'; import { VERSION_NEUTRAL, VersioningType } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { initializeApp } from 'firebase-admin/app'; import { AppModule } from './src/app/app.module'; const NESTIA_CONFIG: INestiaConfig = { input: async () => { initializeApp(); const app = await NestFactory.create(AppModule, { bodyParser: false, }); app.setGlobalPrefix('api', { exclude: ['/_ah/warmup'] }); // 👈 here app.enableVersioning({ type: VersioningType.URI, prefix: 'v', defaultVersion: VERSION_NEUTRAL, }); return app; }, output: 'libs/shared/client/api/src', clone: true, primitive: true, }; export default NESTIA_CONFIG;
Fixes #746.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
@samchon 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.
I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.