Skip to content

Instantly share code, notes, and snippets.

@SteadEXE
Last active May 24, 2022 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteadEXE/2220524c25cbd59ab04ce5d772d7b56e to your computer and use it in GitHub Desktop.
Save SteadEXE/2220524c25cbd59ab04ce5d772d7b56e to your computer and use it in GitHub Desktop.
Deprecated warning fastify-static
import {Module} from '@nestjs/common';
import {ServeStaticModule} from "@nestjs/serve-static";
import {join} from 'path';
@Module({
imports: [
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'public')
}),
],
controllers: [],
providers: [],
})
export class AppModule {
}
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());
await app.listen(process.env.LISTEN_PORT || 3000);
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment