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

typedi + fastify - initialize service asynchronously

I'm working on a nodejs fastify based app service and using typedi for dependency injection. Some services I use need async initialization. MyService.ts export class MyService { constructor() { } public async init() { .... } } I…
user3740951
  • 1,109
  • 2
  • 20
  • 39
0
votes
1 answer

use fastify to download big files as multipart

I have a code that download big objects from S3 using multipart download. I am working now on a microservice that will hide all the s3 operations and in the future will give me the flexibility to change to any object store.I have created a nodejs…
li-raz
  • 1,678
  • 2
  • 29
  • 57
0
votes
1 answer

Why is there Failed Auth error when connecting fastify server to second mongoDB cluster?

I'm trying to add a database connection to a fastify server, for various reasons, this is the scenario, and there are two separate mongodb's that must be connected to. index.js: 'use strict' const dotenv = require('dotenv'); dotenv.config(); const…
Jim
  • 1,988
  • 6
  • 34
  • 68
0
votes
1 answer

How to send http responses to all the connected sockets with fastify-ws in node.js application?

I am using 'fastify-ws' for WebSocket in node.js application. I am using HTTP communication also in the same port. I have to send the HTTP responses through the WebSocket to the connected sockets. This is my sample code: var connectedSockets =…
Alex Isaac
  • 41
  • 1
  • 5
0
votes
1 answer

Getting missing parameter "accessToken" exception using fastify-oauth-server (npmjs)

I set up a fastify server that uses fastify-outh-server with the in-memory-model. I'm trying to connect from postman using a "client_credentials" flow. The server throws an exception "missing parameter: accessToken" when I try to retrieve a…
0
votes
1 answer

How to set a custom Content-Type with fastify in NestJS?

I have an application in NestJS using Fastify. I want to set a the Content-Type to application/hal+json in my responses. I have the following code in a NestJS interceptor: @Injectable() export class SampleInterceptor implements NestInterceptor { …
saulotoledo
  • 1,737
  • 3
  • 19
  • 36
0
votes
2 answers

Validate request body separately from request as a whole

I have a question for validating a PUT request. The body of the request is an array of objects. I want the request to succeed if the body contains an array of at least length one, but I also need to do a separate validation on each object in the…
Stephen Fricke
  • 163
  • 1
  • 2
  • 12
0
votes
1 answer

Fastify point-of-view local variables

I am switching from Express.js to Fastify. I need to do it quickly, so using only API is impossible yet. Haven't written React app. My problem is: I am using point-of-view and I don't know how to pass local variable to all requests. In express there…
Yakov Kemer
  • 373
  • 3
  • 17
0
votes
1 answer

Cannot read property 'encrypted' of undefined

I am trying to set up google oauth2 using Passportjs and NestJS(Fastify as underlying HTTP framework). I am not able to initialize google auth screen and the error comes up every time I try. I have tried a few different ways to do this, but there…
0
votes
1 answer

Usage of Fastify JWT with postgraphile

I am trying to setup postgraphile with fastify server and it worked as expected. Now I added authentication middleware using a fastify-jwt plugin to graphql endpoint exposed by postgraphile but when I access the graphql endpoint using graphql IDE I…
thotam
  • 941
  • 2
  • 16
  • 31
0
votes
1 answer

passport.js not working with nestjs (fastify)

I am using fastifyAdapter instead of expressAdapter on nestjs. it gives me following error- TypeError: res.setHeader is not a function at GoogleStrategy.strategy.redirect
Nikhil Shisode
  • 165
  • 1
  • 15
0
votes
0 answers

Render page in custom HttpExceptionFilter

Does anybody can suggest solution, how to render page in custom HttpExceptionFilter in nest.js, when using Fastify and ejs. Below current HttpExceptionFilter: import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus } from…
user2443795
  • 144
  • 7
0
votes
1 answer

How to use fastify to send multiple URL parameters?

I have declared route using fastify as follows: const apiService = require('./apiService'); try { server.get('/api/status/*', apiService); } catch (err) { console.log(err); process.exit(1); } My api service is defined as follows: async…
meallhour
  • 13,921
  • 21
  • 60
  • 117
0
votes
0 answers

How to optimize queries where one app is used by multiple organisations and using the same db?

Im experimenting with a few different technologies such as graphql, mysql. fastify and react. I came up with a fun app where I would have multiple organizations using the same app and the same db. The difference would be the url. Organisation1…
CodingLittle
  • 1,761
  • 2
  • 17
  • 44
0
votes
1 answer

Is it possible to use Node-Redis in this fashion or will I stick to websockets?

I've been mulling over a design that involves: A client making a POST request to an endpoint The route then publishes (from a constructor that returns a request object which I stringify) to a redis channel. e.g. ( {request: String, transid:…