-
I am consistently getting an error running My Code
I am running locally using a react framework. Upon running
But, when I go to
In the browser, the only console errors I am seeing are:
I am struggling to debug the code with the information provided. Any advice or suggestions would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Bhaney44 👋 I think you are actually missing a root route. As you can see, So, simply add a handler for route like, app.get('/', (req, res) => {
res.send('Welcome to the API server!');
}); Also, you do not need to specify |
Beta Was this translation helpful? Give feedback.
Hi @Bhaney44 👋
I think you are actually missing a root route. As you can see,
/
after http://localhost:3000 is actually the endpoint being requested when you type in http://localhost:3000/ in your browser.So, simply add a handler for route like,
Also, you do not need to specify
cors()
middleware in every route since you are already doing it inapp.use
which will add that middleware for every route.