Category "express"

Unable to authenticate (okta) a post request to a route from within a route getting a 401 Unauthorized response. GET Request works

I have a nodejs app utilising express using @okta/okta-sdk-nodejs and @okta/oidc-middleware to handle authentication. I have a number of routes that work fine a

mongo-connect error with mongo-connect(session)

After searching around about it, I can't find any solution or mistake in my code about this error. I've got my app.js files inside my node JS application with t

RESTDataSource - How to know if response comes from get request or cache

I need to get some data from a REST API in my GraphQL API. For that I'm extending RESTDataSource from apollo-datasource-rest. From what I understood, RESTDataSo

Why is handlebars not working in Node.js?

I have written the line: app.engine('hbs',hbs({extanme:'hbs',defaultLayout:'layout',layoutsDir:__dirname+'/views/layout/',partialsDir:__dirname+'/views/partials

Backend Api error (502 bad gateway) from React Cilent to Express Server during deployment

I am trying to deploy my app on digital ocean (react-express app). During deployment, I used to make my requests to the following endpoint "http://localhost:800

How do I properly set up Passport Google OAuth 2.0 with ExpressJS?

I am trying to set up some user authentication and want to use Google's OAuth2.0 to do so. So far, I have set up a Google API Project at console.cloud.google.co

Can't get redis cache to work with apollo server express

I'm trying to setup a caching system for my apollo express server, but it seems like the guides I've followed from the official docs: https://www.apollographql.

Reading the buffer property of each uploaded file, when there are multiple

I am trying to upload multiple files to my server using multer. Even though I can read the req.files array, but can't access the buffer property of them. I trie

Randomly bad request Nodejs and timeout error client side

Some of our users getting randomly aborted API request. With the exact same API endpoint URL and Payload, I never have this issue. I think it is network related

Mongoose - Update an object inside nested array

My Mongo schema looks like this, I want to update a flashcard object located in an array of flashcard also located in an array of subject. const classrooms = ne

Prevent multiple votes on Node/Express + Pusher JS Voting App

I'm creating a simple voting app where by the client gets to choose from a HTML select dropdown and select an option, and then submitted through a form it fires

how to set up cors() in typescript express

In one of my projects, simply this worked: import cors from "cors"; server.use(cors()); but currently I am having this lovely typescript warning message in my

zip and download folders to local using nodejs

How to zip and download folder from D:/downloads path. As a 1st step, I was able to create a folder inside 'downloads' with dummy content. As a next step I want

node.js req.body returning undefined

EDIT: @LawrenceCherone solved this, its (req, res, next) not (err, res, req) I am creating a MERN app (Mongo, express, react, node). I have some routes that wor

Issue With Paytm payment gateway integration(Custom checkout) in nodejs environment

I am using the nodejs environment to integrate PayTm payment gateway with Custom Checkout approach as mentioned in the link and on this process I need to use th

After jwt verification the state change is not presisting

So on the front end I'm using this function to have the user Log In if they have a This Function only works at the time of log in and after if the users just na

Routing in a lambda function without API Gateway

I have an express app and is deployed via serverless. My stack is just a lambda function + API Gateway. That works and it's accessible on Postman or httpxmlrequ

Aws documentdb MongoServerError: Authorization failure while connecting using mongoose

error: [nodemon] starting `node server.js` app listening on port: 5600 /home/ubuntu/cnox-webbackend/node_modules/mongodb/lib/cmap/connection.js:203

How to redirect to new page with Authorization Headers after login?

I have a login page. On click of login button, the details are sent to server and are validated. A token is received in return after successful validation. I ne

Return many files with json from backend to client

I want to know may i respond to client from backend controller with many files (with application/octet-stream). It will be more better, if i respond array of fi