Category "express"

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

insert into NedB boolean value without quotation marks

I have a NedB database which I'm trying to insert some new data into that I retrieve from HTML form, this is my function to insert new. addEntry(name,desc,ingre

Mongoose query always returns empty array

Im trying to make a greater than query but it always returns an empty array. const productSchema = require("./productsSchema"); const getProductsGreaterThan

require() of ES modules not supported

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\...\node_modules\normalize-url\index.js [0] require() of ES modules is not supported. [0] require

How to send a image jpg/png file from react to express server

I am trying to send an object from react to express server using node.js this is my object: const formData = { location: location, cost: cost, email

How to add attribute to the result of mongoose query before res.status(200).send(result);

I am trying to build a CRUD API that query a mongodb. I want to add another attribute (temperature) to the query result before sending it back to the client. Pa