Project can no longer read files in /public

If you create a new project and then create a front-end file, test.txt, you can then surf to that file like so:

http://puddle-wave.hyperdev.space/test.txt

So far so good. But somehow I’ve lost the ability to do that in this project:

http://honey-shift.hyperdev.space/test.txt

It should show something like above but it says “Cannot GET /test.txt”.

The real reason I care about this is because style.css started 404ing so my project’s main page looks all ugly now. I’m not sure whether it’s HyperDev’s fault but I thought I’d ask about it here in case it’s a known problem or if others have encountered something like that.

You’ve removed the line app.use(express.static('public')); from server.js which tells it the test.txt file is in the public folder. For example, a remixed version of your project https://hyperdev.com/#!/project/noble-spike works with that line added: https://noble-spike.hyperdev.space/test.txt

1 Like

Doh! That was embarrassing. I presumed it was part of HyperDev’s magic to specify a directory for static files. Thanks for spotting that! I’m gradually acquiring a clue about Node. :slight_smile: