index.js
const express = require("express")
const app = express()
const swig = require('swig');
const path = require("path")
app.engine('html', swig.renderFile);
app.set('views','./views');
app.set('view engine','html');
swig.setDefaults({
cache: false
})
app.use("/public",express.static(path.join(__dirname,"public")))
app.use("/",(req,res)=>{
res.render("home")
})
app.listen(3000,()=>{
console.log("running")
})
home.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/public/style.css">
</head>
<body>
<h1>hello world</h1>
</body>
</html>
style.css
body{
background-color: red;
}