Can someone help me with linking a CSS file to an ejs file? I've tried the solution below but it's not working as expected
.css code:
body {
background:url('img.jpg') no-repeat center center/cover;
}
.ejs code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="/CSS/stylesheet.css" type="text/css">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Feddback Form</title>
</head>
<body>
<form action="" method="POST" class="form">
<h1>Store Ownership Feedback</h1>
<div>
<label" for="name">Problem</label>
<input type="text" id="name" name="name" class="box"/>
</div>
<div>
<label for="request">Feedback</label>
<textarea name="request" id="request" cols="30" rows="10" class="box"></textarea>
</div>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
.js code:
const express = require("express");
const { google } = require("googleapis");
const app = express();
app.set("view engine", "ejs");
app.use(express.urlencoded({ extended: true }));
app.use(express.static(__dirname+'/views'));
app.get("/", (req, res) => {
res.render("index");
});
Project Structure: .js:/public .ejs:/public/views .css:/publice/views/CSS