Category "express"

Promise { <pending> } React bcrypt hashing the Password [duplicate]

I am creating a Login/Registration Form Using Nodejs. I am hashing the password entered by the user using bcrypt.js but when I assign the pass

Server can not perform JWT Authentication Request on MERN

I was working on a MERN app and was trying to use jason web-token (JWT) and bcrypt for authentication. It uses two routes for signup and authentication. However

How to set req.body for a video tag?

I would like to set a req.body parameter for the request that the video tag is requesting. The Video tag requests at a certain route to request a video stream.

why am I getting this "Cannot find module server.js"?

I had a Traversy Media tutorial on how to learn the MERN stack that I was following. I had the first part installed on my desktop and it was working properly. o

how can i get the specific info about a user

i'm working on a web app in which a user can create an address when logged in, how can i get the current logged in user address which was created by the user th

How to manually extract context or span from incoming http request in NodeJS?

I trying to migrate my Node.js application from jaeger-client to @opentelemetry/* packages In my Node.js application i have a simple http server and i want to c

Express JS TypeError: Cannot read properties of undefined (reading 'id')

I am trying to build a database query with express js to get a recipe from a table that joins a recipe's information with specific ingredients from a third tabl

Return the data of a model directly instead of a dictionary Express.js and Mongoose

Probably the title isn't very clear and is a bit confusing, and to be honest, I do not really know how to ask this question since I'm new to JavaScript and Mong

How to get a JWT token from one server to another in order to validate APIs which is running on different ports in node & express?

I have two modules in two different server i.e., User and transaction module. User module has one Login API which generates the JWT token, Now I want to send th

Mongoose - get all requried fields only from the schema

I want to apply validation on controller level similar to what we have in a Form Request in Laravel but I want that in Node JS. I want to know the required fiel

How to extract all datas from xml DOM in node JS

I am going to extract all attributes and texts from xml DOM in express Now I am using xml-query node module <?xml version="1.0"?> <OrderMessage

Express Route Testing - req.parameter

How would one test an express route such as app.get('/myapp/:parameter') How would I use jest to test that no parameter was passed? I have an error that will re

Link tag in React is not working with devserver-proxy

I'm following this tutorial to make my React app (localhost:3000) communicate with Node server (localhost:5000) .. so instead of typing <Link to='localhost:5

Unknown authentication strategy Passport js

I want to have 2 different instances of passport Js for my app (user and admin - both with jwt authentification ). I read in the official documentation that the

Why do i get 502 Bad Gateway error in my async express.js middleware?

I have a node API which is deployed and run as a Lambda function inside AWS. // mthd export const validateHeaderBearerToken = (req, res) => { if (!req.heade

react-router-dom v6 StaticRouter context is not working

I'm trying to make SSR React web application. Everything works fine except staticContext. My server code is // IMPORTS const renderer = (req, store, context) =

supertest gets timeout error when I use await in a controller

const express = require('express'); const router = express.Router(); const Product = require('./../model/product'); router .route('/api/product') .get(async

How to subscribe a new member to mailchamp using node.js and express

I am trying to work with an API, specifically mail-chimp API, but the problem that I am having is: const express=require("express"); const bodyparser=requir

Express server can't read key in Docker container

I am dockerizing a system that uses a pem and key to authenticate with a remote dev server. Unfortunately, it would appear that it is unable to find the file de

res.send return two or more items from a map method

I'm doing a get request and it fetches properly. From there I have to return that data based on the if statement, but the data needs to be returned as an object