Cannot get / [ ]

Project Link:

I downloaded the initial code to do the above project and I was able to create routes and get json response on the browser for every route I have implemented as per the project. However I am not able to load the UI. Every time I run server.js I get an error Cannot get /

Finally I downloaded the solution file for the boss machine project and it also has the same problem. I tried adding a route app.get('/', (req, res) => { res.render(__dirname +'/index.html'); } and that loaded the index.html without any css and the react component is not attached to it.

Can you please suggest what I need to do load the UI as I would very much like to see the routes in action on the UI.


I found the same issue on Expresso project capstone-project-2-expresso-start and I guess I fixed it by running npm start to start the UI and node server.js to start the api. There were some modules that are not supported like browserHistory which lead to few hours of google search in finding alternatives.

Also had to install cors dependency as UI and API were running on two different ports, along with moving the css to the src folder.

These are the few of the steps that I took to see the UI and API in action together. If there is a totally different way or a better way to achieve this, please let me know.

First start the api server with ‘npm run start’. This does not start the UI, it just allows you to use the API. To view the website/UI, follow the instructions from the project page " To see the application in its initial, non-working state, simply open index.html in a web browser."

I use Live Server in Visual Studio Code to open the index.html page.