Questions tagged [fastify]

Fast and low overhead web framework for Node.js (https://www.fastify.io)

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express.

The official website of Fastify is www.fastify.io. The source can be found on GitHub.

Useful links:

Older versions

671 questions
0
votes
2 answers

Fastify: Is it possible to access envs registered in one file via fastify-env in another file?

Here's my problem. I want to load the envs from .env file and use those values in the db connection string. So I'm trying to do the setup by creating two setup files: One that loads the envs, the other that uses them to form the connection string…
Ayudh
  • 1,673
  • 1
  • 22
  • 55
0
votes
1 answer

Fastify Throws Unfulfilled Promise Error On File Uplaod

I'm learning Fastify so I've written a simple program to upload files using Fastify-Formidable. The file is successfully uploaded and moved to it's destination directory with the help of the mv package. However, as this happens, Fastify throws an…
Hamza.B93
  • 3
  • 2
0
votes
1 answer

how to access payload from fastify-http-proxy in the prehandler hook

I am developing an application where I need to hit this endpoint https://api2.transloadit.com/assemblies to upload a file of any type. I wish to add authentication params from the server before hitting the final endpoint Please Note: It is…
0
votes
1 answer

Why does specifying the URL as '0.0.0.0' allow my NestJS-fastify app to deploy to Heroku?

When I was trying to deploy my NestJS app to Heroku I was seeing the error Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch Why does setting the url to 0.0.0.0 make it work? const port = process.env.PORT ||…
0
votes
1 answer

How to save fastify swagger api description to local file

Hi is there is any possibility to save API swagger YAML to local file when starting the project? I'm using fastify-swagger plugin using exposeRoute enable true and call '/documentation/yaml' API allowed to download YAML via the browser but i need to…
chathun
  • 169
  • 1
  • 4
  • 12
0
votes
0 answers

Nodejs fastify : one route to make two http calls

I'm new to fastify and nodejs I would like to create a route, allowing me to retrieve the information of the top 1 film thanks to the themoviedb API First, I have to get the first movie that sends back the road…
Cohchi
  • 543
  • 3
  • 9
  • 19
0
votes
1 answer

x-doc tag behavior understanding in fastify-swagger

I have the following versions: fastify (3.20.1) and fastify-swagger(4.8.4) I am using fastify in a Node js/JavaScript environment. Now in my route.js, while I am specifying the fastify.route -- I am writing these two additional tags (after the…
Pradip
  • 509
  • 1
  • 5
  • 22
0
votes
0 answers

NodeJS with fastify and dd-trace - Datadog doesn't trace for post with body

My problem is pretty the same as here: https://github.com/DataDog/dd-trace-js/issues/830. The issue is marked as resolved, but I still have it. My post declaration: fastify.post<{ Body: any; Response: any; }>('/test', function (_request:…
clsbartek
  • 186
  • 1
  • 3
  • 18
0
votes
1 answer

Fastify-passport req.user is null, deserializer never gets called nor does the serializer

i've been struggling a lot with fastify-passport library, mainly because it seems that nobody uses it and there aren't any good examples or issues related to it anyhow, i have some routes defined like this: const adminRoutes = [ { handler:…
M1S0
  • 29
  • 7
0
votes
1 answer

What does `async` mean in JavaScript when it is *not* followed by `function`?

I stumble upon this code snippet while working on fastify. module.exports = async function (fastify, opts) { fastify.register(proxy, { upstream: 'htt‌ps://news.ycombinator.com/', async preHandler(request, reply) { if…
han
  • 97
  • 1
  • 1
  • 5
0
votes
1 answer

Use mercurius, fastify with typegraphql make an error

I am trying to use typegraphql with mercurius and fastify I have copied this intergration from mercurius documentaion, when I add the built schema to mercurius it show me an error in this way: When I remove it, the error disappear This is the…
Ghyath Darwish
  • 2,614
  • 4
  • 15
  • 31
0
votes
0 answers

Return empty array in Fastify handler with async/await function

I'm trying to make a web3 wallet with Moralis with Fasitify in back and VueJS in front. (I would like to say that I already do this in web client (vuejs) and everything works well!) In my back, I fetch all the asset from user. It works, I get them…
Jo Le Belge
  • 137
  • 1
  • 2
  • 14
0
votes
0 answers

MongoDB "cyclic dependency detected"

I have read several posts regarding this error but I can't seem to diagnose mine. I am getting a cyclic dependency detected with MongoDB when I use curl to send a JSON file POST request: {"statusCode":500,"error":"Internal Server…
Victor M
  • 603
  • 4
  • 22
0
votes
1 answer

NestJS + Fastify e2e testing: Jest did not exit one second after the test run has completed

While running end-to-end tests of NestJS+Fastify application I noticed the following warnings: Jest did not exit one second after the test run has completed. This usually means that there are asynchronous operations that weren't stopped in your…
Daniel Kucal
  • 8,684
  • 6
  • 39
  • 64
0
votes
1 answer

Fastify-http-proxy unable to get dynamic routes

I have a fastify server that's pointing to two "backend" fastify servers and I'd like to generate a random number that is then used to decide which backend to route to. Currently it only works the first time, and I'm unable to override the upstream…