Category "express"

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

Mongoose.connect is not connecting to local db

I'm building a simple MERN blogging app with a local MongoDB. Everything was working fine until yesterday. I literally changed nothing at all and now I can't co

What is wrong with my code? I am trying to authenticate a user login with expressjs and mysql?

I am trying to figure out what part is wrong? I get this error: ERROR----- var pwdCompare = await bcrypt.compare(password, pwdCompare[0].password); TypeError: C

"Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0" ERROR -- NodeJS, MongoDB, React Application

I'm trying to fetch an array from my user database from my react app. The response I'm getting is an HTML file, but I'm not sure why it's not working as I have

Can I prefill Mobile number field in stripe express Onboarding?

Can I prefill the Mobile number field in stripe express Onboarding? Image This is my code, Here I am able to prefill all fields except phone number. I have tri

Reload not working with mern stack on heroku

I have deployed my mern stack to heroku with this code: import express from "express"; import path from "path"; const app = express(); const port = process.env

node and express - how to use fake data

It's been a while since I used node and express and I was sure that this was possible, but i'm having an issue of figuring it out now. I have a simple postgres

HTTP POST request test is not getting passed

I wrote some nodejs codes to be evaluated by a particular test file, candidate.test.js but surprisingly the test keeps failing. Below is the error I am getting:

eventlistener not functioning when post request is sent

I am trying to add a number indicator to my cart icon that will display the number of items added after the product has been saved to my database. <div class

GET json api data in datatable with axios and vuejs

I have a datatable and I want to pass the data according to the api that returns a json using findAll() from the sequelize.. But in console.log when I call the

Twilio send sms with nodejs not sending message

I am using twilio to send sms using nodejs, but sometimes it not working, not going to catch or not going to then, above it calling, client also created but cre

exceljs error when reading csv file uploaded from windows

When uploading csv file created by windows; an error is generated when trying to parse the file using exceljs. Here is the error message: message: "Can't find e

Stripe Construct Event: No signatures found matching the expected signature for payload. Javascript, Express

I get an error whenever I try to construct the stripe webhook event: No signatures found matching the expected signature for payload. Are you passing the raw r

AWS Beanstalk -> "unsafe-perm=true" in .npmrc file for AWS Beanstalk not working

Hi there I am using AWS Beanstalk to deploy my Express app for the first time right and when I try to upload my Express app I get an error saying this: [ERROR]

Retrieve two foreign keys nodejs sequelize

I have a route and I want it to send two primary keys as foreign keys to my orderline table. I have three tables a customer, address and orderline table. an ord

Express.js backend not saving cookie to Nuxt.js frontend

I've built an authorization server with Express.js that works when testing with Postman where it saves the access and rotating refresh token as signed cookies.