提供静态文件。
项目描述
提供简单高效的服务静态文件的方式。用作演示。如果您的系统上可用,则可处理sendifle api。
需求
Python 2.5或更高版本
Gevent > 0.13
Pistil >= 0.1.0
http-parser >= 0.6.3
注意:要设置进程名称,请安装库setproctitle
$ ps ax|grep test_cors 78064 s002 S+ 0:00.35 arbiter [test_cors running 3 workers] 78065 s002 S+ 0:00.10 worker test_cors [78065] 78066 s002 S+ 0:00.11 worker test_cors [78066] 78067 s002 S+ 0:00.09 worker test_cors [78067]
安装
从PyPI安装,执行以下命令之一
pip install fserve
或
easy_install fserve
从源安装
$ git clone git://github.com/benoitc/fserve.git $ cd fserve && python setup.py install
用法
$ fserve [-h] [--bind BIND] [--workers WORKERS] [--debug] [path] serve a static file folder positional arguments: path Folder to serve optional arguments: -h, --help show this help message and exit --bind BIND The socket to bind. A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. An IP is a valid HOST. --name NAME name of the server --workers WORKERS Number of workers --debug Debug mode
示例
在您的源文件夹中
$ cd examples/static $ fserve --workers 3
然后访问http://127.0.0.1:5000 URL。
项目详情
关闭
fserve-0.2.0.tar.gz的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | cfb4e0d896aa5c8dd842bac2cbf3816bf9838d28fe9f524e149c96f7e85a6b83 |
|
MD5 | c32a219d32c326e26591d80d25b32faa |
|
BLAKE2b-256 | 243a087480c6b0e15227f5942b7fa3f70209bedc84d544c32821e5292157bc28 |