Alex Riskus Alex Riskus - 1 month ago 10
CSS Question

Express.js can't get my CSS files

app.use(express.static(path.join(__dirname, '/public')));


I can't get my CSS files using Express.js but it works using the links.

html
head
title Welcome
link(rel='stylesheet' src='/css/bootstrap.css')
link(rel='stylesheet' src='/css/bootstrap-theme.css')
script(type='text/javascript' src='/javascripts/jquery.js')
script(type='text/javascript' src='/javascripts/bootstrap.js')
body
div(class='container')
input(type='submit' class='btn btn-success')
h1 Users
- each name in names
p= 'Username: ' + name.name

Answer

Try using the following syntax for including css:

link(rel='stylesheet', href='/css/bootstrap.css')

Just as an html style tag takes an href attribute, so does link within jade.