28 lines
992 B
TypeScript
28 lines
992 B
TypeScript
/* 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();
|