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
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.
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.
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.