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

Detect the end of a request

Is it possible to detect the end of a request? I'm writing a plugin/middleware (with fastify-plugin) and I'm currently getting all the asset requests when I just want the route itself. In Express I can place my middleware after the body parser and…
NetOperator Wibby
  • 1,354
  • 5
  • 22
  • 44
-1
votes
1 answer

How to securly verify user by passwordless magic link?

Problem: I am in the process of creating a straightforward passwordless authentication system for users to perform basic CRUD operations. Approach The overall login process is as follows: The user visits the magic link page If the email is valid, a…
IvonaK
  • 119
  • 10
-1
votes
1 answer

Get vs Post requests with vercel serverless functions

Nodejs frameworks like express and fastify allow user to declare routes like so fastify.get("/:id/projects", async (request: GetProjectRequest, reply) => {}) which ties particular routes to particular types of requests. The vercel docs suggest…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
-1
votes
2 answers

How to use fastify-cors and node JS to allow multiple urls in cors origin

My URL list look like this const urls = ["example1.com", "exam.com"] My cors setting look like this: const cors = require("fastify-cors") // Enable CORS fastify.register(cors, { origin: '*', methods: ['GET', 'POST'], credentials:…
-1
votes
1 answer

Node JS Global Variables is not working after call

I'm trying to call my global variables in my controller but i got an error variable is not defined. Please see the code below for your reference. Hoping to solve my problem. Thank you Guys **server.js ** const serverConfig =…
John Nico Novero
  • 539
  • 5
  • 10
-1
votes
1 answer

Is there any way to ignore backslashes and forward slashes in link route?

I am making a user Authentication system and it sends users a confirmation email when user registers, the problem I'm facing is that sometimes link contains / and \ .due to this any text after the / was considered as new route. Is there any way to…
-1
votes
1 answer

Facing unexpected tokken '?' error in fastify 4

I am working in node application, there I am using fastify but it not working as expected. Environment, node : 13.14.0 npm : 6.14.4 package.json file is index.ts file When running the application it throws an error as below,
Udhayakumar
  • 357
  • 5
  • 19
-1
votes
1 answer

How to setup and teardown a Web server with Jest

I'm using Jest, and need to setup a Web server for running tests and then tear it down afterwards. How can I implement this?
ObiHill
  • 11,448
  • 20
  • 86
  • 135
-1
votes
1 answer

Fastify stops in production mode

Hello I want to run fastify with react build files for front-end. I don't know why when I run my server, it stops after running. yarn run v1.22.10 $ node dist/src/index.js Server is ready at port 4000 Done in 3.03s. my…
Mj Ebrahimzadeh
  • 587
  • 9
  • 22
-2
votes
1 answer

SNS publishes to the SQS queue but the SNS subscription is not consuming the messages published to the SQS queue

Do I have to consume the message separately with SQS? Publishing my message with SNS and consuming with SQS feels weird to me. This is the pubsub implementation export const awsSNSPlugin = fp(async server => { const snsService = new SNS({…
1 2 3
44
45