Squashed commit of the following:
commit 0cf879b38318f9b27a74ddf556ea02f49ab8ea02
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 14:12:17 2023 +0300
apps/api: add swagger
commit 5d99d2bbbc186e40bfcd8a4aa84ea57e76f8d046
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 12:50:38 2023 +0300
apps/api: rename users module -> account
commit 724d8ccf2844109593567dc004bd0338b9a5d64c
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 12:29:48 2023 +0300
apps/api: add users functional
commit 9c7665440623a7bc8780186b0f4aeb86039b7e3f
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 00:21:15 2023 +0300
docker-compose.yml: fix mongo volume path
commit bc82c05afd3b8829b48b2a956398b05ef15bd361
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 00:18:37 2023 +0300
docker-compose.yml: add mongo
commit d372007e0e841b1ca0fc89acf5bdf98c2a27fe72
Author: vchikalkin <djchikalkin@gmail.com>
Date: Wed Nov 1 00:06:12 2023 +0300
apps/api: move /auth method to root
commit a42aa89aec567845d26748d43fae5554e8a29e6c
Author: vchikalkin <djchikalkin@gmail.com>
Date: Tue Oct 31 21:58:39 2023 +0300
apps/api: move redis caching feature to ldap module
commit 01422661e82f82fd8080a760fe30428247517c9b
Author: vchikalkin <djchikalkin@gmail.com>
Date: Tue Oct 31 17:50:55 2023 +0300
apps/api: remove apps controller & service
commit e0f9893a1aea546839086e84940adb820583be27
Author: vchikalkin <djchikalkin@gmail.com>
Date: Tue Oct 31 17:49:26 2023 +0300
apps/api: rename authModule -> ldapModule
commit f1114cb703c4759d2b2b899031182adace81f898
Author: vchikalkin <djchikalkin@gmail.com>
Date: Tue Oct 31 17:29:01 2023 +0300
apps/api: remove ldap module and replace with utils
commit a8179a324a23e4553ce0a58de02ad303ce49ca1e
Author: vchikalkin <djchikalkin@gmail.com>
Date: Tue Oct 31 16:30:15 2023 +0300
apps/api: add CRUD account feature
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
/* eslint-disable import/no-duplicates */
|
|
/* eslint-disable unicorn/prefer-top-level-await */
|
|
import { AppModule } from './app.module';
|
|
import { env } from './config/env';
|
|
import { fastifyCookie } from '@fastify/cookie';
|
|
import type { INestApplication } from '@nestjs/common';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import type { NestFastifyApplication } from '@nestjs/platform-fastify';
|
|
import { FastifyAdapter } from '@nestjs/platform-fastify';
|
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|
|
|
function setupOpenApi(app: INestApplication) {
|
|
const config = new DocumentBuilder()
|
|
.setTitle('Evo.Auth')
|
|
.setVersion('1.0')
|
|
// .addTag('api')
|
|
.build();
|
|
const document = SwaggerModule.createDocument(app, config);
|
|
SwaggerModule.setup('swagger', app, document, { useGlobalPrefix: true });
|
|
}
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create<NestFastifyApplication>(
|
|
AppModule,
|
|
new FastifyAdapter({
|
|
logger: true,
|
|
})
|
|
);
|
|
|
|
await app.register(fastifyCookie, {
|
|
secret: env.API_SECRET,
|
|
});
|
|
|
|
app.useGlobalPipes(new ValidationPipe({ stopAtFirstError: true }));
|
|
|
|
setupOpenApi(app);
|
|
|
|
await app.listen(env.API_PORT, '0.0.0.0');
|
|
}
|
|
|
|
bootstrap();
|