import { NestFactory } from '@nestjs/core' ; import { FastifyAdapter , NestFastifyApplication } from '@nestjs/platform-fastify' ; import { join } from 'path' ; import { AppModule } from './app/app.module' ; /**
 * This is not a production server yet!
 * This is only a minimal backend to get started.
 */ async function bootstrap ( ) { const app = await NestFactory . create < NestFastifyApplication > ( AppModule , new FastifyAdapter ( ) ) ; const globalPrefix = 'api' ; app . setGlobalPrefix ( globalPrefix ) ; const port = + process . env . port || 3333 ; app . useStaticAssets ( { root : join ( __dirname , './assets/uploads' ) , prefix : '/uploads/' } ) ; await app . listen ( port , ( ) => { console . log ( 'Listening at http://localhost:' + port + '/' + globalPrefix ) ; } ) ; } bootstrap ( ) ;