Error: No default engine was specified and no extension was provided

前端 未结 14 2560
别跟我提以往
别跟我提以往 2020-11-29 18:13

I am working through setting up a http server using node.js and engine. However, I keep running into issues that I have little information on how to resolve I would apprecia

14条回答
  •  迷失自我
    2020-11-29 18:48

    If you wish to render a html file, use:

    response.sendfile('index.html');
    

    Then you remove:

    app.set('view engine', 'html');
    

    Put your *.html in the views directory, or serve a public directory as static dir and put the index.html in the public dir.

提交回复
热议问题