#How do I exclude path to global prefix
7 messages · Page 1 of 1 (latest)
imports: [
ConfigModule,
MongooseModule.forRootAsync({
inject: [ConfigService],
useFactory: async (configService: ConfigService) => configService.getMongoConfig(),
}),
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'uploads'), // Path to the uploads directory
serveRoot: '/uploads', // Optional: Specify the root URL path for the served files
exclude: ['/api/v1/*'],
})
]
add exclude to the app.module.ts
hope you have great profit
🤣
as well as
import { ServeStaticModule } from '@nestjs/serve-static';
I don’t know if it’s really the same, but I found that I can make it easier from the same code of:
app.setGlobalPrefix(‘api/v1’, { exclude: [‘/’] });