| 12345678910111213141516171819202122 |
- import 'dotenv/config';
- import { NestFactory } from '@nestjs/core';
- import { AppModule } from './app.module';
- import * as fs from 'fs';
- import * as path from 'path';
- async function bootstrap() {
- const httpsOptions = {
- key: fs.readFileSync(path.resolve(__dirname, '../cert/127.0.0.1+1-key.pem')),
- cert: fs.readFileSync(path.resolve(__dirname, '../cert/127.0.0.1+1.pem')),
- };
- const app = await NestFactory.create(AppModule, { httpsOptions });
- app.enableCors({
- origin: 'https://192.168.100.100:4200',
- credentials: true,
- });
- await app.listen(process.env.PORT ?? 3000);
- }
- bootstrap();
|