enter image description here I’m trying to login as a user on my website and it’s giving me this error, I can register the user and search for it in the login as many times as I want if the password and username are correct, however when there is an error in the user name or password it happens this
Tag: express
res.redirect() not working properly in express JS
I’ve been working on creating an API for a blockchain I’ve made. Everything was going fine, until I updated Node and Windows… ====== ISSUE ====== After performing a POST request, I cannot redirect to a GET page anymore. (Using Postman only no front end yet). For some reason, it was working fine and now I can’t do it in a
Integrate Nodejs Backend with React Frontend App
I am building an app that uses node.js for backend and react for frontend. In the backend, i have 2 functions that implement a post request. In my react function: I want to show a spinner while waiting for the response data from the API request. For the triggerGrading function which only returns ok if successful, I want to be
In express.js, when to use a middleware and when to use a regular function?
I am making a login authentication module using a regular function in my project. However, I see many developers online using middleware to achieve the same purpose. I am so confused about when to use middleware and when to use a normal function. In general, when is it appropriate to use middleware, does it somehow related to some specific scenarios?
app.get() has 3 parameters, I need an explnation Node JS , express
I’m a noob. I have a question. I’m using passport-google-oauth20 as you can clearly see , this rout ( app.get() ) has 3 parameters, and this is the first time I used something like this, can anyone please explain the logic/theory behind this ? normally I use but in this special case, there are 3 parameters. can you provide me
Error: Cannot remove headers after they are sent to the client
I was working on admin registration and admin data retrieving react app. The registration works fine but retrieving admin data is crushing my backend. I have encountered this error when call the given endpoint from my react app. But when I call it from Postman it works very fine. And when I see the console on my browser my react
Express get request with an :id-parameter being run twice
I have an API made with node and express, and the end goal is to store the :id-parameter from the request in a variable so that I can query a specific table from my SQLite database with a specific id. Now the get request with an :id-parameter is being run twice, once with the request url being what it´s supposed
Why does my array from backend doesn’t print in the frontend ReactJS?
I have a simple ‘Submit a post’ project with 2 inputs (title and description) and a submit button. Whenever I press submit, I send the title and description value to the backend where it it stored there in an array called submittedPosts. For example: Code in the backend: The problem is – I can’t print ALL the array in the
How to query based on a field in a referenced document in mongodb
I have two MongoDB collections. First is Products, and the seconds is Users. The product documents has a field ownerId which refers to the users collection and the user has a Boolean field isActive. What I want to do is to find all the products where their users are active using Mongoose method collection.find(). I don’t know if i can
Google Maps API using Node.js and Express
i have an idea for a website that takes in ufo information from a certain API. i have been able to display information such as the location of the encounter. the API also returns coordinates of the encounters and i want to display a map with a marker of said location. the only way I’m able to obtain the specific