I have problem with linking my css/js on my page.
Linking on localhost:5000/books/1
not working
but on the page localhost:5000/books/
working
app.use(express.static(__dirname + "/public"));
bookRouter.route('/')
.get(function(req,res){
res.render('books',{title:"Tytuł", nav:[
{
Link: "/Books",
Text: "Books"
},{
Link: "/Authors",
Text: "Authors"
}],
books: books
});
});
bookRouter.route('/:id')
.get(function(req,res){
var id = req.params.id;
res.render('bookView',{title:"Tytuł", nav:[
{
Link: "/Books",
Text: "Books"
},{
Link: "/Authors",
Text: "Authors"
}],
book: books[id]
});
});
app.use('/books',bookRouter);
Route work but not linking css/jss. It looking in http://localhost:5000/books/lib/bootstrap/dist/css/bootstrap.min.css