Category "express"

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

Chrome browser can not read source map its from Express socket.io

My problem is : DevTools failed to load source map: Could not load content for chrome-extension://flijfnhifgdcbhglkneplegafminjnhn/content/socket.io.js.map: Sys

Error when set sameSite from strict or lax to none - HTTP only cookie - ExpressJS

I am running on a MERN stack project. Back-end runs on port 5000, and front-end runs on port 3000. After I've built to production, I pushed the server file to H

Connection failure error unable to handle in passport-windowsauth, how to handle it

I'm trying to connect ldaps server using passport-windowsauth. If I provide valid credential the connection is working fine. If the credential is not valid then

Displaying function values onto an already existing EJS template

I need to display a value from a JS file (indexRoutes.js) into an input box on an EJS template (calculator.ejs), I have included the script via a footer I have

Mongoose Schema for Groups (a number of users in one group)

One aspect of my website is that people can join groups according to a specific code provided to them, for example- when we play 'Kahoot' or 'Psych', we have to