Cannot link the style.css file on Route()

Hey guys, i have a problem on my project. So if i define a route like this :slight_smile:


const express = require("express");
const router = express.Router()

router.get("/shop", (req, res) =>{
  // code goes here 

module.exports = router;


let shopRoute = require("./routers/shop.js");

app.use("/list", shopRoute);

The router works fine but stil.css not loading. Any idea?

Have you defined your static asset folder?

yes i did it on shop.ejs file. I did it too :


You should include that on your main “controller” file (index.js, server.js, etc)

i defined my public folder in my server.js file

Can I see where you link your style.css file?

The EJS file?

<!DOCTYPE html>
<h1>Shop List</h1>
<div align = "center" class = "shop-container">
<li><%= item1 %></li>
<link rel = "stylesheet" href = "stil.css">

Can you share a link to your code/project name? I also think Riverside wanted to see the res.render.. line.

nevermind guys i fixed it thanks a lot again