Gold medal project - solution code not rendering on localhost

https://www.codecademy.com/paths/web-development/tracks/sql-for-web-development/modules/project-gold-medal-metrics/informationals/bapi-p5-gold-medal-metrics

Following instructions after running solution code.

The server runs fine on port 3001.

Opening localhost:3001 shows ‘Cannot GET /’ but not rendering the app.

Does the solution code render for anyone?

1 Like

This took me a while to figure out and there’s probably a better way.

In server.js, I added:
app.use(express.static('public'); //line 13 below the CORS expression

I then made a new folder called /public

Then I moved /build, /css, /img, index.html, and index.js into the /public folder.

Open the recently moved index.js and add a period to the app import so it goes up one level:

import App from '../App'; // replace line 3

Reload the server, open localhost:3001, and it worked!