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
1 answer

How to work with error handling in fastify

I'm creating a rest api for a work project using fastify, i'm far enough into the project where I'm starting to figure out error handling in my project. However, I can't seem to get my head wrapped around how to implement error handling properly in…
TechEmperor95
  • 389
  • 1
  • 4
  • 18
0
votes
1 answer

retriving data in the validation and serialization. problem with fastify

Fastify validation-and-serialization problem: const Joi = require('@hapi/joi') fastify.post('/the/url', { schema: { body: Joi.object().keys({ hello: Joi.string().required() }).required() }, validatorCompiler: ({ schema, method,…
hyden97
  • 117
  • 2
  • 8
0
votes
2 answers

fastify-mongoose doesn't work, node.js and fastify

const ejs = require('ejs') const path = require('path'); const fastify = require('fastify')(); const fastify_static = require('fastify-static'); const fastify_autoload = require('fastify-autoload'); const fastify_mongoose =…
hyden97
  • 117
  • 2
  • 8
0
votes
0 answers

invalid_grant issue in GoogleStrategy using Passport, Fastify

I'm using passport.js to use google OAuth in my application. I'm using Nodejs, Fastify. I'm getting this response while I'm trying to log in. I tried refreshing Secret, Client ID by deleting and making new Credentials in Google Cloud Console.…
5war00p
  • 368
  • 1
  • 5
  • 15
0
votes
1 answer

"push" types in Typescript

I'm using the fastify package where type definitions depend on the configuration options you set for it (for example whether you create http or http2 server). I would like to retain these dynamic types in files that the fastify calls (for example a…
0
votes
0 answers

Fastify app returns 400 when deployed on Cloud Run

I have an app created with fastify, when testing the app in dev mode everything works fine but when deployed to cloud run I get error 400. This is only happening when one of parameters is too long (for example 7400 characters), the error I see is a…
0
votes
1 answer

Markup support for fastify swagger

Hello Fastify experts, I am using fastify and fastify-swagger for creating OAS-3 (3.0.3) API specification from my schema definition. I am able to create nice html so embed into it. However when I am using markup (rich text, like === heading, ---…
Pradip
  • 509
  • 1
  • 5
  • 22
0
votes
0 answers

How to open port with Fastify?

I'm trying to use Fastify with my project, but when I want to start the server, it isn't opening the specific port. I'm creating the server like this: import { NestFactory } from "@nestjs/core"; import { NestFastifyApplication, FastifyAdapter } from…
Danstadje
  • 23
  • 4
0
votes
2 answers

Can't make PUT requests from client side to Fastify backend

I'm trying to update information from the client side with a PUT request to my Fastify server, but nothing is being sent. No Errors displaying either, just no change. POST and GET requests work fine from the client side. PUT requests work in…
Eric Pezzulo
  • 299
  • 4
  • 18
0
votes
1 answer

Axios HTTP requests not sending to Fastify backend

I'm trying to send a simple get request to my fastify server with axios, but i keep getting this error in the terminal: Network Error at node_modules/axios/lib/core/createError.js:15:17 in createError at node_modules/axios/lib/adapters/xhr.js:114:22…
Eric Pezzulo
  • 299
  • 4
  • 18
0
votes
1 answer

UnhandledPromiseRejectionWarning: TypeError: Channel credentials must be a ChannelCredentials object in GCP Batch publishing

I am trying to do batch publishing of messages using node module @google-cloud/pubsub. My batch publishing code looks like below. const { PubSub } = require("@google-cloud/pubsub"); const grpc = require("grpc"); const createPublishEventsInBatch =…
viz_tm
  • 115
  • 1
  • 1
  • 7
0
votes
0 answers

Fastify schema fails to validate type of a property of a nested object

I am new in using Fastify Js. I have this route that fails to validate the type of properties inside the nested object from inside the body schema. fastify.put('/comment', { schema: { body: { type: 'object', …
Eric Echemane
  • 131
  • 1
  • 6
0
votes
2 answers

Fastify reload browser

In Fastify framework is there anyway to reflesh the browser when changes happen on save. In Express we have npm livereload as a middleware to listen to backend changes in Express. Are there any similar functions in Fastify or do I have to write my…
Stacky
  • 3
  • 5
0
votes
1 answer

How to access mongodb via the plugin fastify-mongodb

My plugin looks like import fp from 'fastify-plugin'; import mongodb from 'fastify-mongodb'; export default fp(async (fastify) => { fastify.register(mongodb, { url:…
Bill
  • 4,614
  • 13
  • 77
  • 132
0
votes
2 answers

Fastify not defined when trying to sign a jwt with fastify-jwt

In my handler I want to be able to sign a JWT but 'fastify' is not defined. const postJoinHandler = async ( request: any, reply: any ): Promise<{ id: string; name: string }> => { try { const { username, password } = request.body; const…
Bill
  • 4,614
  • 13
  • 77
  • 132