关于建立本地web服务器的几种方法

来源:互联网 发布:资金趋势指标公式源码 编辑:程序博客网 时间:2024/05/21 10:18

一、用python ------- 适合大多数UNIX/Mac系统

       大多数的UNIX/Mac系统都已经安装了python,在这些系统中很容易地建立本地web服务器

        >python  -m SimpleHTTPServer

        Serving HTTP on 0.0.0.0 port 8000..

       在你签出或下载的源代码目录下运行上述命令

二、用NPM --------如果你已经安装了Node,js

       第一种使用 http server 模块:

     >npm install -g http-server

     >http-server 

    Starting up http-server, serving ./ on port : 8080

     Hit CTRL-C to stop the server 

    第二种 Simple HTTP Server:

    >npm install -g simple-http-server

    >nserver

    simple-http-server Now Serving: /Users.jos/git/Physijs at http://localhost:8000/

三、用Mongoose 

       首先,从https://code.google.com/p/mongoose/downloads/list下载特定平台的二进制文件,如果是windows平台,把文件复制到示例所在的目录,双击它,即可启动一个web服务器

     

0 0