app.get('/', function getState(req,res,next){ res.sendfile(`${__dirname}/index.html`)})index.html 內(nèi)容<!DOCTYPE html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <meta name="format-detection" content="telephone=no" /> <title>Title</title></head><body><div>Hello World</div></body></html>在瀏覽器顯示為什么會以字符串的形式渲染出來的呢?
express 返回一個 html 文件,前端如何渲染出?
BIG陽
2018-12-20 22:18:01