1.首先确保是全局安装
npm install http-server -g
2.例如我的某个目录结构
3.进入目录敲命令
4.浏览器访问
例如http://localhost:8081/index.html或http://localhost:8081/app.js
这里的react目录就变成服务器的根目录了
1.首先确保是全局安装
npm install http-server -g
2.例如我的某个目录结构
3.进入目录敲命令
4.浏览器访问
例如http://localhost:8081/index.html或http://localhost:8081/app.js
这里的react目录就变成服务器的根目录了
转载于:https://www.cnblogs.com/jiye123/p/7999144.html