Session
import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import { AppModule } from './app.module';
// CookieSession import
// tsconfig문제로 require를 이용하여 불러옴
const cookieSession = require('cookie-session')
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// CookieSession 적용
app.use(cookieSession({
keys : ['asdfasfd']
}))
app.useGlobalPipes(
new ValidationPipe({
whitelist : true
})
)
await app.listen(3000);
}
bootstrap();세션을 이용하여 정보 조회하기
Last updated