chore: initial commit — monorepo ReadaBook (API NestJS, web PWA, Docker)
This commit is contained in:
20
apps/api/src/main.ts
Normal file
20
apps/api/src/main.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import "reflect-metadata";
|
||||
import cookie from "@fastify/cookie";
|
||||
import "@fastify/cookie";
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import { FastifyAdapter, NestFastifyApplication } from "@nestjs/platform-fastify";
|
||||
import { AppModule } from "./app.module.js";
|
||||
import { loadConfig } from "./config/env.js";
|
||||
|
||||
async function bootstrap() {
|
||||
const config = loadConfig();
|
||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter({ logger: true }));
|
||||
await app.register(cookie as never, { secret: config.jwtSecret });
|
||||
app.enableCors({
|
||||
origin: true,
|
||||
credentials: true
|
||||
});
|
||||
await app.listen(config.port, config.host);
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
Reference in New Issue
Block a user