玉石脚本标签正在渲染html

时间:2014-01-26 13:05:33

标签: javascript node.js express pug mean-stack

我有一个使用带有文件views/index.jade的jade模板的快速应用程序:

extends layout

block body
    div
        h2 My Blog
    ul
        li
            a(href='/') Home
        li
            a(href='/addPost') Add a new post

    div(ng-view)

    script(src='js/lib/angular/angular.js')
    script(src='js/app.js')
    script(src='js/services.js')
    script(src='js/controllers.js')
    script(src='js/filters.js')
    script(src='js/directives.js')

html在浏览器中渲染得很好,但是当我查看javascript文件时,它都是html!

为什么jade为我的javascript文件渲染html?

js files filled with html

1 个答案:

答案 0 :(得分:0)

woops,我改变了

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

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

应该是什么时候:

app.use(express.static(__dirname + '/public'));

谢谢@karolis