I am new in nodejs and i am using "expressjs" framework,And i am trying to show simple static page using "pug" extension but "css" file is not loading/working Here is my file strcture
demo(Main Project/root)
index(Main file)
views
public
views
dashboard
style.css
And here is index.js code
var express = require('express')
var app = express()
//app.use("/styles", express.static(__dirname + '/styles'));
var path = require('path');
app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'pug');
app.use(express.static(path.join(__dirname, 'public')));
app.get('/first_template', function(req, res){
res.render('index');
});
app.listen(3000)
Here is my index.pug code
html
head
title Dashboard
link(rel='stylesheet', href='/views/dashboard/style.css')
body
p Hi!
How can i add "style.css" to index.pug ? Where i am wrong ?