-1

App.js -> main js express file so I make like this

const express = require('express');
const app= express();
app.use(express.static('public'))

Main Layou -> main Layout handlebar file , i add a link tag to style like this (main.hbs)

<link rel='stylesheet' href='/style.css'>

Files And Folder Structure I have other hbs files in views , but when I add style link to separate file it does work but it not working when in main layout hbs

project-root/
│
├── app.js
│
├── public/
│   └── style.css
│
├── routes/
│   └── routes.js
│
└── views/
    ├── layouts/
    │   └── main.hbs
    ├── create.hbs
    ├── edit.hbs

I tried like this in my server : localhost/ cssfilename

It displays the style code

Also in style.css i added body background colour: black and input types width :250px

6
  • Have you checked the console and the network monitor for errors or problems? Can you post a minimal reproducible example of the generated code?
    – jabaa
    Commented Jul 7 at 13:43
  • @jabaa Yes I checked console , there's no issues
    – Vicky X
    Commented Jul 8 at 1:50
  • Can you post a minimal reproducible example of the generated code?
    – jabaa
    Commented Jul 8 at 7:03
  • @jabaa what's that??
    – Vicky X
    Commented Jul 8 at 14:14
  • You have a backend server that generates websites. In the backend server you have code. The interesting part is, what the backend server generates with this code and sends to the browser. If you don't get any error messages, I would expect a problem in the frontend. If it's a problem in the frontend, I don't need the backend code.
    – jabaa
    Commented Jul 8 at 14:17

0