import { NestFactory } from '@nestjs/core';
import * as session from 'express-session';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(
session({
secret: 'my-secret',
resave: true,
saveUninitialized: true,
}),
);
app.enableCors();
await app.listen(3001);
}
bootstrap();
session.user = user;
session.isAuth = true;
await session.save((err) => {
if (err) console.log(err);
});