forked from SlimeVR/SlimeVR-Firmware-WebBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnestia.config.ts
More file actions
32 lines (29 loc) · 974 Bytes
/
nestia.config.ts
File metadata and controls
32 lines (29 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { INestiaConfig } from '@nestia/sdk';
import { NestFactory } from '@nestjs/core';
// import { FastifyAdapter } from "@nestjs/platform-fastify";
import { AppModule } from 'src/app.module';
const camelize = (word: string, index: number) =>
!word || index == 0 ? word : word[0].toUpperCase() + word.slice(1);
const NESTIA_CONFIG: INestiaConfig = {
input: async () => {
const app = await NestFactory.create(AppModule);
// const app = await NestFactory.create(YourModule, new FastifyAdapter());
// app.setGlobalPrefix("api");
// app.enableVersioning({
// type: VersioningType.URI,
// prefix: "v",
// })
return app;
},
swagger: {
output: 'dist/swagger.json',
beautify: true,
openapi: '3.0',
operationId: ({ path, method }) =>
`${method.toLowerCase()}_${path.substring(1).replace(/\/|-|{|}/gi, '_')}`
.split('_')
.map(camelize)
.join(''),
},
};
export default NESTIA_CONFIG;