Last active
March 17, 2019 19:52
-
-
Save BrunnerLivio/cd0bb683a73bfcb90d3c0ffd7dcac412 to your computer and use it in GitHub Desktop.
NestJS fastify 6.0.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ curl localhost:3000 | |
{"statusCode":404,"error":"Not Found","message":"Not Found"}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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