Atualização repositorio
This commit is contained in:
27
src/main.ts
Normal file
27
src/main.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import * as fs from 'fs';
|
||||
|
||||
async function bootstrap() {
|
||||
|
||||
// const privateKey = fs.readFileSync('cert/portal_juru.key', 'utf8');
|
||||
// const certificate = fs.readFileSync('cert/portal_juru.crt', 'utf8');
|
||||
// const httpsOptions = { key: privateKey, cert: certificate };
|
||||
// const app = await NestFactory.create(AppModule, {
|
||||
// httpsOptions,
|
||||
// });
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
// const app = await NestFactory.create(AppModule);
|
||||
//Configurando o CORS
|
||||
app.enableCors({
|
||||
origin: '*', //'http://portal.jurunense.com', // Especifique a origem permitida ou use '*' para permitir todas
|
||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', // Métodos HTTP permitidos
|
||||
credentials: true, // Permitir envio de cookies
|
||||
allowedHeaders: 'Content-Type, Accept', // Cabeçalhos permitidos
|
||||
});
|
||||
|
||||
await app.listen(3001);
|
||||
}
|
||||
bootstrap();
|
||||
Reference in New Issue
Block a user