lite-server
来源:互联网 发布:Ubuntu配置caffe CPU 编辑:程序博客网 时间:2024/05/07 11:46
lite-server
轻量级的仅适用于开发 的 node 服务器, 它仅支持 web app, 它能够为你打开浏览器, 当你的html或是JavaScript文件变化时,它会识别到并自动帮你刷新浏览器, 还能使用套接字自动注入变化的CSS, 当路由没有被找到时,它将自动后退页面。
Why
在一个轻量级的开发服务器中,浏览器同步能够支持我们的大多数需求. 它提供静态的内容, 监测文本变化, 刷新浏览器, 并且提供更多自定义功能.
When creating a SPA there are routes that are only known to the browser. For example, /customer/21
may be a client side route for an Angular app. If this route is entered manually or linked to directly as the entry point of the Angular app (aka a deep link) the static server will receive the request, because Angular is not loaded yet. The server will not find a match for the route and thus return a 404. The desired behavior in this case is to return the index.html
(or whatever starting page of the app we have defined). BrowserSync does not automatically allow for a fallback page. But it does allow for custom middleware. This is where lite-server
steps in.
lite-server
is a simple customized wrapper around BrowserSync to make it easy to serve SPAs.
安装与使用
以下是被推荐的安装lite-server的方式:
$ npm install lite-server --save-dev
在你的项目中的 package.json
文件中添加一个 “script” 入口:
- lite-server
- lite-server工具使用
- 使用lite-server快速搭建本地服务器
- mxnet : parameter-server/ps-lite阅读既要
- ISAPI_Rewrite Lite
- SOAP::Lite
- firebug lite
- SQL Lite
- DIDL-Lite
- jCarousel Lite
- UDP-Lite
- IRC lite
- iconv-lite
- Sql Lite
- TensorFlow Lite
- Photon官方Lite类中Lite Concepts
- Flash Lite 1.1
- Delphi 2006 lite
- Linux之HA高可用集群的基础概念总结
- Java代码使用ffmpeg视频按帧存储
- 使用jquery动态添加导航页卡和标题
- 京东订单
- Bean
- lite-server
- c++继承(子类调用父类函数、全局函数)
- Shiro学习参考
- dash激活
- *.问题记录集1
- 机器学习笔记(九)隐马尔可夫模型
- Android鬼点子-自定义View就像PS
- 全面的购物车
- TCP协议与UDP协议的区别