question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to switch to Fastify

See original GitHub issue

I’m submitting a…


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Better cold-start times when running in serverless environment

Environment


Nest version: X.Y.Z

 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
neilimecommented, Oct 31, 2018

I’ve tried to use fastify as explained in https://docs.nestjs.com/techniques/performance, wihout success :

Always get an error “[PackageLoader] The “fastify” package is missing. Please, make sure to install this library ($ npm install fastify) to take advantage of FastifyAdapter.”

Even if I manually load fastify package in main.ts. Examples:

  • const fastify = require('fastify');
  • import fastify from 'fastify';

Maybe it will be usefull to be able to pass the fastify instance to the adapter :

const fastify = require('fastify');

enableProdMode();

async function bootstrap() {
  const app = await NestFactory.create(ApplicationModule, new FastifyAdapter({
    instance: fastify
  }));
  app.enableCors({
    methods: 'GET',
    maxAge: 3600,
  });
  await app.listen(4000);
}
bootstrap().catch(err => console.error(err));

0reactions
Sikora00commented, Aug 24, 2022

@invaderb no I haven’t. I don’t think I could handle maintenance by myself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Routes - Fastify
method : currently it supports 'DELETE' , 'GET' , 'HEAD' , 'PATCH' , 'POST' , 'PUT' , 'OPTIONS' , 'SEARCH' , 'TRACE' ,...
Read more >
How to Migrate Your App from Express to Fastify - SitePoint
We're going to change it to: import fastify and fastify-express instead of express; create a Fastify server instance instead of an Express ...
Read more >
Fastify Crash Course | Node.js Framework - YouTube
Fastify is a "fast" Node.js framework. ... Creating a Controller 22:37 - Fastify Swagger API Documentation 24:47 - Add Item POST 30:22 ...
Read more >
Fastify vs Express Which is Better? | Fastify TypeScript Tutorial
We create a new application from scratch using typescript and the fastify CLI. We also take a look at how JSON Schema factors...
Read more >
Performance (Fastify) - A progressive Node.js framework
But since Nest provides framework-independence, you can easily migrate between them. Fastify can be a better choice when you place high value on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found