Skip to content

Instantly share code, notes, and snippets.

@BrunnerLivio
Last active March 17, 2019 19:52
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 BrunnerLivio/cd0bb683a73bfcb90d3c0ffd7dcac412 to your computer and use it in GitHub Desktop.
Save BrunnerLivio/cd0bb683a73bfcb90d3c0ffd7dcac412 to your computer and use it in GitHub Desktop.
NestJS fastify 6.0.0
// DOES WORK
import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, new ExpressAdapter());
await app.listen(3000);
}
bootstrap();
// DOES NOT WORK
import { NestFactory } from '@nestjs/core';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, new FastifyAdapter());
await app.listen(3000);
}
bootstrap();
➜ curl localhost:3000
{"statusCode":404,"error":"Not Found","message":"Not Found"}%
# upgrade nest cli
npm i -g @nestjs/cli@6.0.0
# create a new test project
nest new fastify-test
cd fastify-test
# Upgrade to 6.0.0
npm i -s @nestjs/core@6.0.0 @nestjs/common@6.0.0 @nestjs/platform-fastify fasitfy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment