我完全是Express.js的初学者,我正在尝试使用Express,js, Jade和Less建立一个简单的网站。我创建文件夹项目的方法是:
$ mkdir myProj
$ cd myProj
$ express --sessions --css less
最近我听说了bootstrap,我想把它包含在我的项目中。我试着找到关于如何添加和包含bootstrap的在线教程,我尝试这样做的方式是:
--> download bootstrap from the official page
--> add the downloaded folder in public/lib/bootstrap
--> include the css files in the layout.jade as follows: link(rel='stylesheet', href='/lib/bootstrap/css/bootstrap.css')
就我所见,它正在工作。但我不确定这是否是在Express.js中包含bootstrap的正确方法。是否有其他方法包括在Express.js bootstrap和我的方式是正确的?
这个怎么样?
$ npm install -g twitter-bootstrap-node
# Create the project: (Default css engine is "less",And template engine is "jade")
$ twitter-bootstrap project
$ cd project
$ node app.js