Server.js not updating despite remix and refresh


#1

My project https://glitch.com/edit/#!/rollerblade-sw-test has gotten into a state where changes to server.js are not reflected when you view the project at https://rollerblade-sw-test.glitch.me/.

Edits to project files cause a refresh, but what is run is not the contents of server.js, but stale contents. I’ve tried remixing the project and also running refresh from the console. Neither had any effect.


#2

Hi @lawnsea,

The reason is that package.json has node main.js in the start script, so the entry point of your server is main.js, not server.js :slight_smile:


#3

package.json has node main.js in the start script, so the entry point of your server is main.js, not server.js

True, but note that main.js is not actually serving the page. If it were, https://rollerblade-sw-test.glitch.me/ would just show “FIXME: render README”. Changing the entry point to main.js was something I tried to get my project out of its stuck state.


#4

It is serving main.js, it’s serving the valid public/index.html file first due to the app.use express.static before your GET route. Comment out the static line, or limit it to /public route or rename the public/index.html file if you want to see the content of your GET route instead.


#5

Doh! Thanks, Gareth!