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
0 answers

how to design the infinity in sqlite3 with sequelize and nodejs?

How should i define the infinity in my database. i use nodejs fastify sequelize sqlite3 There are a few data should deal with: deadline: unlimited time or a date, type:string format:date usetimes: infinity type:number Do i need to change the…
radiorz
  • 1,459
  • 4
  • 18
  • 36
0
votes
2 answers

how can i use exceljs in fastify?

I use exceljs like this but it returns a error. TypeError: pipe.write is not a function and "message": "Cannot read property 'summary' of undefined" let workbook = new Excel.Workbook() let worksheet = workbook.addWorksheet('calogs') …
radiorz
  • 1,459
  • 4
  • 18
  • 36
0
votes
0 answers

Handle response payload with fastify-reply-from

My goal is to manipulate the response payload after the response already returned to the client, but it looks impossible doing it with fastify + fastify-reply-from without affecting the response time. Here is the only way I could get the response…
user3164429
  • 140
  • 1
  • 10
0
votes
0 answers

nestjs+fastify stopped working after upgrade

What I did: I upgrade nest js using nest update -f -t latest, the package version diffs are below. before "@nestjs/bull": "^0.1.1", "@nestjs/common": "^7.0.7", "@nestjs/core": "^7.0.7", "@nestjs/graphql": "^7.3.7", "@nestjs/platform-fastify":…
sora
  • 1,061
  • 2
  • 12
  • 23
0
votes
1 answer

When using fastify-session and fastify-webockets, how do I get access to the session?

When I use both fastify-websocket and fastify-session in my Fastify app, I run into an issue. fastify.get( myWebsocketPath, websocket: true }, async (connection, rawRequest) => { console.log(`request for websocket connection`) …
eadsjr
  • 681
  • 5
  • 20
0
votes
1 answer

Node.js - Fastify: Connection closed during sleep (setTimeout)

I am having a problem with a Node.js server using Fastify. At some point during the execution of a request, the server seems to be closing the connection and the client is getting a socket hang up error. The logic in the server is: Fastify client…
secuf
  • 35
  • 1
  • 5
0
votes
1 answer

Implementing load protection for Fastify Node js

Story: As a developer, I wanted to implement load protection for Fastify so that the server load can be protected against server crashes. Context: Root cause analysis of serious performance issues can take time. In the case of a live deployed…
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219
0
votes
3 answers

Need to upload image to AWS S3 server using fastify-multer getting [Function: multerPreHandler] error

Packages used const fastify = require('fastify'); const multer = require('fastify-multer'); const server = fastify(); server.register(multer.contentParser); var AWS = require("aws-sdk"); var s3 = new…
baba-voss
  • 1
  • 1
  • 3
0
votes
1 answer

Is there a potential data leak when redirecting from http to https?

I have the following code in my Fastify server hosted on Heroku: this.server.addHook('preHandler', async(req, reply) => { const isHttps = req.headers['x-forwarded-proto'] === 'https'; if (isHttps) { return; } const { method, …
Sammy
  • 3,395
  • 7
  • 49
  • 95
0
votes
0 answers

Fastify Http Request Queue + Socket Disconnect Events

Is there a way of getting access to the fastify request queue in NodeJS? And also knowing when each request in the queue has been disconnected from the sender? Thanks in advance!
0
votes
0 answers

Chrome makes two requests to NodeJS server

When I make a POST request in Chrome to my NodeJS Fastify server, Chrome's network tab displays one post request: However, Fastify logs two requests each with a unique request ID: Now, what is crazy is that when I perform the same request in…
now_world
  • 940
  • 7
  • 21
  • 56
0
votes
0 answers

NestJS Fastify graphql e2e test failures

I have a simple NestJS + Fastify + Graphql app, however when I try to use fastify in my e2e, the tests are erring out. I can't seem to figure out the issue here. Anybody else seen this? When I run the app, everything works as expected. Depedencies…
Busch
  • 857
  • 10
  • 29
0
votes
2 answers

fastify schema validation with trim

I have written a schema as follows input: { type: "string", allOf: [ { transform: [ "trim" ] }, { …
user3740951
  • 1,109
  • 2
  • 20
  • 39
0
votes
1 answer

issue with nestjs + fastify-http-proxy

I am trying to build a Nestjs api proxy (pass through). I found this package which is very simple to use: fastify-http-proxy. The problem is I don't know how to use this package within Nestjs. Does anybody here any experience with this,…
Zhiyuan Zhang
  • 41
  • 1
  • 5
0
votes
1 answer

Apollo Graphql with Fastify

I have been trying to run Apollo Ghraphql server with Fastify. Code snippet for index file below:- const { ApolloServer } = require('apollo-server-fastify'); const fastify = require('fastify')({ logger: true }) const config =…
khushboo29
  • 906
  • 6
  • 16