Monday, September 18, 2023
HomeCSSCreating Node.js/Specific/EJS and many others app... In my views dir I've my...

Creating Node.js/Specific/EJS and many others app… In my views dir I’ve my dwelling.ejs, and an index.ejs which might be an identical. Why wont my dwelling.ejs show css?


This has brought on me a lot hell. I discover that the issue I am having is my ‘dwelling.ejs’ file, with the route set to “https://stackoverflow.com/”. The web page shows with none CSS. It does not matter which EJS view I path to with the (“https://stackoverflow.com/”) backslash get route… THAT view won’t show the CSS correctly coded into <head> which is correctly within the partials and included.

Searching for the issue, I created an ‘index.ejs’ in my views dir, copy and pasted all code from ‘dwelling.ejs’ in order that they had been an identical. I set the route ‘/index’ for ‘index.ejs’. Now after I load my “localhost:3000/” I see dwelling.ejs with out css. “localhost:3000/index” although offers me the css and web page I need. What’s going on right here?

– Listed here are photos of my code:
:{[My Proj Directory](https://i.stack.imgur.com/l5WfO.png)
[My ‘index.js’ (JavaScript) file](https://i.stack.imgur.com/BnENd.png)
[‘home and index ‘ejs’ files side-by-side](https://i.stack.imgur.com/0niL1.png)

**That is my first time posting a query. Sorry if I organized my query horribly… Thanks upfront for any assist :_)

To summarize what appears the difficulty… If I try to make use of the essential get(“https://stackoverflow.com/”) route for any .ejs file, no css is displayed

RELATED ARTICLES

Most Popular

Recent Comments