I have a business hours object in a mongoose schema that represent a date. I'm passing a json object and retrieving the to parse to Date as string. I wonder if
This is the code I took from my professor's tutorial. LoginComp is just {username: '', password: ''} const request = new Request("/users/login", { method: "
userSchema.methods.generateAuthToken = async function() { const user = this const token = jwt.sign({_id:user._id.toString()},'thisisnewcourse') ret
I have written a code on my server(NodeJS) that will send a .csv file to the frontend with express res.download(path). I would like to know how I can handle the
Event Hub is fast to send but slow to get. I use next code: subscribe(cb: (event: any) => Promise<void>) { this.consumerClient.subscribe(
I use pg-promise and i tried to make a request to database in user model to get an array of all users like this: exports.getAllUsers = function () { let
I am using AWS Elastic Beanstalk for hosting Express/Node.js API server. It's working well with just normal APIs but I am getting this 504 Timeout error with on
I need advice, what is the best way to store a JWT token? Should we store in cookies or storages? But with the CSRF flaw and xss attacks I have a doubt. I'm sti
My app works on development but gives Text Encoder error in production. When I run the Node index.js command, I get the error "TextEncoder is not defined". Erro
I have this assignment and I'm a bit stuck. When I press the button on the site the console I get this error: GET http://localhost:3000/getUser 404 (Not Found)
I am trying to build an application in my Express and anytime i navigate to the admin page i get this error const castError = new CastError();
Screenshot of the error: Code of client side: jwt attached api: Here's the jwt verifying function: const authHeader = req.headers?.auth
I have a NodeJS Application written in KoaJS, app.ts const app = new Koa(); app.use(healthCheck()); app.use(bodyParser()); app.use(errorHandler()); app.use(end
Re: https://www.npmjs.com/package/express-openapi#getting-started On many projects I've been worked on (in other technologies) we would always support multiple
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
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
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
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
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
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