feat: implement supplier management module with create, update, find, and delete functionalities
- Added CreateSupplierDto for supplier creation - Added UpdateSupplierDto for supplier updates - Implemented SuppliersController to handle HTTP requests for suppliers - Created SuppliersService to manage supplier data using Prisma - Integrated SuppliersModule to encapsulate suppliers-related components
This commit is contained in:
+16
@@ -24,6 +24,22 @@ async function bootstrap() {
|
||||
defaultVersion: '1',
|
||||
})
|
||||
|
||||
// Enable CORS. You can set `CORS_ORIGINS` to a comma-separated list of allowed origins.
|
||||
// Defaults include common localhost origins used by front-end dev servers.
|
||||
const defaultOrigins = ['http://localhost:3001']
|
||||
const envOrigins = process.env.CORS_ORIGINS
|
||||
? process.env.CORS_ORIGINS.split(',')
|
||||
.map(s => s.trim())
|
||||
.filter(Boolean)
|
||||
: []
|
||||
const allowedOrigins = envOrigins.length ? envOrigins : defaultOrigins
|
||||
app.enableCors({
|
||||
origin: allowedOrigins,
|
||||
credentials: true,
|
||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
|
||||
allowedHeaders: 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token',
|
||||
})
|
||||
|
||||
// Register global logging and response mapping interceptors
|
||||
app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user