25 lines
655 B
TypeScript
25 lines
655 B
TypeScript
/* eslint-disable unicorn/prefer-top-level-await */
|
|
import { AppModule } from './app.module';
|
|
import { env } from './config/env';
|
|
import { fastifyCookie } from '@fastify/cookie';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import type { NestFastifyApplication } from '@nestjs/platform-fastify';
|
|
import { FastifyAdapter } from '@nestjs/platform-fastify';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create<NestFastifyApplication>(
|
|
AppModule,
|
|
new FastifyAdapter({
|
|
logger: true,
|
|
})
|
|
);
|
|
|
|
await app.register(fastifyCookie, {
|
|
secret: env.API_SECRET,
|
|
});
|
|
|
|
await app.listen(env.API_PORT, '0.0.0.0');
|
|
}
|
|
|
|
bootstrap();
|