Deleted public folder, now cant create new public folder

Kinda strange problem:

I started out with Glitch doing a bot, so I deleted the content of the public folder and also the folder itself I think. It doesn’t show up when I do “ls -la” in console but I can “cd” into it.

Now the problem is:

-decided to make a website for that bot
-created a new file and called it “public/style.css”
-created a new file and called it “views/home.html”
-tried to reference my CSS with <link rel="stylesheet" href="/style.css"> in the tags
-doesnt work, but works on a fresh created Glitch

What can I do pls help someone

Hey @JaielSoft, this probably has something to do with how Glitch handles static web sites vs how it handles web page rendering in Node.js projects. My guess is that your project isn’t mounting the public folder as a statically-rendered directory.

If you care to provide your project name, someone can probably give some project-specific guidance.

I think I made it private don’t want it to be public anyways ( if thats possible I dont know I activated the lock symbol)

That’s fine. If your project is private, no one aside from folks you explicitly invite and a few Glitch staff will see your code (in part so we can help with problems like this). However you’re welcome to send a message to the @support_staff group or myself, or to send an email to support@glitch.com with your project details.

Ive send you a message

I wasn’t able to test this completely, but I think if you add app.use(express.static('public')); in your webmanager sometime after you define app but before you attach any other routes you should be able to reference your styles.css file.

Happy Glitching!

1 Like

Thank you very much it was a blunder to oversee that new projects have this line. It worked, I just didnt have it, thanks!!!

1 Like