Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 months ago. Improve this question i have a destroy function the delete is working but it keeps returning
Tag: express
Mongo Organize by object inside aggregate request
My project is in nodeJs with express and i use mongoose for the request to my database mongoDb. I have a model Media the structure is: Like you seen there is a field date, imagine that i have 3 medias on differents month: I want to output something like this: Is found the property aggregate but i don’t understand it
Unable to select certain fields in MongoDB (Mongoose) result
I’ve ran into a bit of an odd issue with a mongoose result. I can select one value from the object, but not another. For example I’m calling I get a result and im console logging out the entire product. The result is: I can log out the storePrice field However if I try to log out the dropDate and
Return function output to component in react js
AOA, I want to return the output of useAuth.the output will be returned to ProtectedRoute component and as it is will be returned to layout.js. let me know if you need more info Private Route.js layout.js Answer You can not use a component returned from useEffect instead you should be using a state for this.
fetch() is spamming my API with thousands of requests
I have the following function which gets an image from my API: It did work, but now when I run the function it spams the API as the console gets flooded with “Fire” and my server gets thousands upon thousands of requests. Answer You named the function fetch so it overwrites (or shadows, depending on the scope your function is
Req.params and req.user missing after hitting stripe checkout flow
I’m trying to integrate Stripe subscriptions billing in my app with a tiered pricing model and based on my understanding, I need to do two things: Allow my new users to also create a stripe customer account (via the integration) Monitor Stripe webhook ‘events’ to provision access while customer subscription payments are active My userflow is as follows: create profile
ExpressJS Login Validation Error: comparePassword is not a function
In the folder backend/controllers I have an authController class which handles a POST request with an email and password and then looks for a user in the database with a matching email, then when it finds the user, it tries to verify the password invoking a method called comparePassword which is defined in the user class located in backend/models. The
Created an object in my index.js file, how to make it available in a router file?
I have an index.js file where I: initialize my Express app instance include a router.js file that defines a POST endpoint create a Socket.IO object code as follows: At the POST endpoint in router.js, I want to use the Socket.IO object like this: But this gives me the error: How do I make the io object available to this router.post()
How can i check a JWT token is valid using an async function route with nodejs?
I am following the guide below to verify that only registered users can send requests to my backend nodejs server, my frontend is sending requests with an authorization header that contains a token and that part is working well. The nodejs backend should then check the token is valid before sending a response: https://www.tonyvu.co/posts/jwt-authentication-node-js The example shows i should add
How to access POST data in express js?
Im using (in the browser): on the client side browser. I’m using (node js): to get the post data. but it doesn’t matter what I send it doesn’t show up. I don’t wanna have to install some separate “body parser” package to see the data…. I don’t wanna parse it. A post request is used to send data to the