【文件属性】:
文件名称:javascript:JavaScript学习笔记
文件大小:738KB
文件格式:ZIP
更新时间:2021-02-10 14:07:01
HTML
2021/02/08问题:路由不起作用
const path = require('path');
app.get('/',function(req,res){ res.sendFile(path.join(__ dirname +'/index.html')); });
控制台错误Unchecked runtime.lastError:消息端口在收到响应之前已关闭。
chrome :: extensions / =>删除扩展名
由于MIME类型未加载样式表
在server.js中添加以下代码app.use(express.static(__ dirname +'/ public'));
公开> CSS> style.css 公开> img> img.png
在index.html中包含样式表=>无需再次编写public,因为我们是在server.js中完成的
CSS自定义光标不