Category "node.js"

Fastify Swagger, add tag and description to fastify route

I'm using fastify 3.28.0 (plus fastify-swagger plugin) with typescript 4.6.2, and I'd like to add tags, description and summary inside every route. From docs: f

why my condition expression for attribute not exist fails in dynamodb

My DynamoDB table has a primary key as id. The same id will be used to query a record. Now I want to insert a record with id and originalURL as attributes, I wa

I am trying to host a project I built on two separate repositories

I have a MEAN stack project that is built on two separate repositories. The backend is using Node.js and handles all API routing to MongoDB Atlas. If i wanted t

near-api-js Failing to connect to near

Was making a svelte implementation of a near app. We have a button that connects to the testnet network. It will open wallet to sign in. When successful, it wil

TS - NodeMailer OAuth2 'auth' does not exist in type 'TransportOptions

I have a problem. I need to make email sending function with Gmail api. In docs it tells me to make a createTransport function like this: const transport =

how to redirect nextjs app to https on cpanel

I'm new whit Reactjs and Nextjs and I develop an online shop project, I deploy it on a Cpanel and I want to redirect it on SSL port HTTPS how to do it app.js: c

Submitting a video with Thumbnail to Facebook Graph API for Instagram

I have this endpoint that is currently working flawlessly for both photos and videos. let mediaContainerUrl = `https://graph.facebook.com/${igUserId}/media`; A

Mongoose ValidationError makes Express Server crashed

I have struggled with this problem for many days. Whenever I make an invalid POST request, it throws me an Error. Sounds good but when I cancel that request, th

Mongoose ValidationError makes Express Server crashed

I have struggled with this problem for many days. Whenever I make an invalid POST request, it throws me an Error. Sounds good but when I cancel that request, th

req.cookies returns [Object: null prototype] {} even if the cookie is set

I try to store and read a cookie via cookie-parser. Setting the cookie is working fine. Its listed under the "Application"-Tab of the dev tools: But if i try t

how to set expiration of password in aws-cognito with node js

I am trying to do something like - All user passwords should expire every 90 days. Users should be forced to reset their expired passwords upon login to sha

Objectionjs: relation with multiple columns but some column could be null

I have a Model, using Objection JS, with this relation: class Model....{ ... static relationMappings = { ... evs:{ relation: Model.ManyToManyRelat

How can I use the new URL API to get request details?

After following a tutorial on Node.js I tried to get the details of a request like so: const url = require('url'); http .createServer((req, res) => {

importing fs in nodejs

hello everyone! I'm trying to import fs module in nodejs first I was using require to import it like this const fs = require('fs'); It was working fine for a w

How to use next() function in Next JS API like Express JS?

While making an API in Next JS, where I pass three parameter to my API function (req, res, next) here is the code : import catchAsyncErrors from "../../../middl

Save data found from mysql to local variable [duplicate]

I'm trying to save the returned data from MySQL to a local variable, This is what I tried const queryUser = "SELECT * FROM Users WHERE email

How can I set a flash variable in Next.js before a redirect?

Laravel in PHP made this easy with https://laravel.com/docs/9.x/session#flash-data, so I figured Next.js would have an easy way too. I thought I'd be able to do

Unable to install grpc-tools via npm or yarn on mac m1 chip?

Commands Used to install: npm install -g grpc-tools yarn add global grpc-tools While trying to install grpc-tools on mac m1 BigSur. I ran into errors pasted

How to use feathers with graphql?

I want to build graphql in feathers. And try below method。 from index.js /* eslint-disable no-console */ const logger = require('./logger'); const app =

Make a change to the database with Prisma.js without having to reset the whole thing

How can make a change to the database with Prisma.js without having to reset the whole thing? if I have used this command npx prisma migrate dev --name role-mak