Category "express"

How to delete and insert with a single command in mongoDB?

So, I have a collection like this: [{ "name":String, "address":String, "hobby":Array of Strings }...] Every hour I query an API and get the response l

Storing sessions with express-session, connect-mongo, and mongoose

I am looking for guidance on setting up session based authentication with with Express-Session, connect-mongo, and Mongoose. Currently it's just generating a ne

why hashedPassword = await bcrypt.hash(this.password, salt) is not working?

I'm basically trying to just hash a password using bcrypt using async/await but nothing is working... next() is not working and it is not saving the data into t

Why does Zod make all my schema fields optional?

I am using Zod inside my Express & TypeScript & Mongoose API project and when trying to validate my user input against the user schema it returns types

Why does Zod make all my schema fields optional?

I am using Zod inside my Express & TypeScript & Mongoose API project and when trying to validate my user input against the user schema it returns types

setting up s3 bucket to handle cross origin resource policy

I am facing issues playing audio files from my s3 bucket. I was wondering if I set up the cross origin resource policy poorly. Here is my server.js file: app.us

Can't receive SMS message with Twilio trial account

I have a small project (Express) using a Twilio trial account to send an SMS message to my phone number. But when I use my own message to replace the example st

getting error while trying to make put request to mysql in nodejs

I am getting this error while I am trying to send a put request to update a row of a product table in mysql using nodejs. Here's my code: exports.updateProduct=

postgres returns another table column while inserting data in sequelize

When I try to insert new category, I got this error: error: column "image" does not exist sql: 'INSERT INTO "Categories" ("id","createdAt","updatedAt") VALUES

Jest TestEnvironment - TypeError: Cannot add property next, object is not extensible

I want to test a node API using Jest. I am testing the routes and websockets. Testing the routes was no problem. I simply started the server using the setupFile

How would I able to get search results in elastic search using mongoosastic?

I am trying to use mongoosastic search() but it doesn't give me the result. Data is saved in MongoDB as well as elasticsearch. Below is the mongoose schema cons

Issue while sending messages on WhatsApp at specific time everyday using Node.js

I'm writing a program in Node.js which sends a WhatsApp template every day at a specific time. I used node-cron and setInterval. When I deployed the program on

Can't make Axios post request to Express server (CORS)

I've been trying to make a simple image upload form using react, axios and multer, but I can't figure out a way to deal with cors ! Here is my form (running on

Must provide typeDefs when using makeAugmentedSchema

I'm new to Neo4j and GraphQL and more or less new to JavaScript. I want to build a GraphQL endpoint using ApolloServer and Neo4j. The error I don't understand

Modify Request Headers Using ExpressJs

Is it possible to modify request headers using ExpressJs? I have an expressjs app server that interfaces with multiple backend services and I'd like to have thi

express-jwt - typeError: done is not a function

I'm using express-jwt to control the user privileges of my startup project, but I'm getting an error when I try to request access (using Postman) an api that on

Helmet Express ERR_BLOCKED_BY_RESPONSE.NotSameOrigin 200

please I need help, I checked on all google and not get really answer for to open my issue. I want to use helmet to secure my express server. But when I am usin

Use req.user instead of User.findOne when updating MongoDB sub-documents?

I am using Passport.js for Express, which already holds the current user in the session variable req.user. Yet when I try to update a MongoDB database I can onl

Use req.user instead of User.findOne when updating MongoDB sub-documents?

I am using Passport.js for Express, which already holds the current user in the session variable req.user. Yet when I try to update a MongoDB database I can onl

Passport authenticate access to req

I have set up azureAD login with passport in my Express-server. I would like to access the req object in the passport.authenticate middleware, is this possible