zoukankan      html  css  js  c++  java
  • linux简单快速启用web

    Python的SimpleHTTPServer
    需要先安装python,然后执行
    $ python -m SimpleHTTPServer     //当前目录为根目录,端口在8000的服务
    $ python -m SimpleHTTPServer 9000     //当前目录为根目录,端口在9000的服务
    为了更快速的使用,我们可以在.bashrc或者.zshrc里alias一下
    alias servehere="python -m SimpleHTTPServer"
    在命令行里,执行一下 $ servehere 就可以开启服务
    $ python2
    Python 2.7.17 (default, Mar 21 2020, 00:47:07)
    [GCC 9.3.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.

    注意: python3 改为下面的命令了
    $ python -m http.server
    Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
    $ python
    Python 3.8.2 (default, Feb 26 2020, 22:21:03)
    [GCC 9.2.1 20200130] on linux
    Type "help", "copyright", "credits" or "license" for more information.


    serve 这是一个npm的模块,首先需要先安装 nodejs 和 npm,然后安装
    $ npm install -g serve
    $ serve     //当前目录为根目录,默认端口在3000的服务
    $ serve --port 8000      //当前目录为根目录,指定端口在8000的服务
    $ npm info serve
    serve@11.3.0 | MIT | deps: 9 | versions: 133
    Static file serving and directory listing
    https://github.com/zeit/serve#readme


    需要域名绑定的时候可以用apache或者nginx
    jser.me/2013/11/22/快速启动web服务的两种方式.html
    https://blog.csdn.net/hzhsan/article/details/44677867
    https://blog.csdn.net/sun172270102/article/details/50820683
    添加虚拟网卡
    http://blog.51cto.com/mengzhaofu/1846545

    ===============

  • 相关阅读:
    //判断安卓 和ios
    不同屏幕适配
    在iOS设备下,h5的input框失焦后页面被顶起来一部分bug 用css解决办法
    div跟随手指滑动
    滑动事件
    手指长按事件
    es6数组属性
    loading加载百分比 以及根据加载进度移动元素
    刮刮乐
    h5上传图片并预览
  • 原文地址:https://www.cnblogs.com/sztom/p/10184599.html
Copyright © 2011-2022 走看看