20 lines
528 B
TypeScript
20 lines
528 B
TypeScript
|
|
import { NestFactory } from '@nestjs/core';
|
|
|
|
import { AppModule } from './app.module';
|
|
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
|
|
|
async function bootstrap() {
|
|
|
|
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(), {
|
|
cors: true,
|
|
logger: ['error', 'warn']
|
|
});
|
|
app.setGlobalPrefix('api');
|
|
|
|
await app.listen(3000, () => {
|
|
console.log('Application is running on: http://localhost:3000');
|
|
});
|
|
}
|
|
bootstrap();
|