小型开发Web服务器
webdev的Python项目详细描述
关于
这是一个用于开发或共享的小型Web服务器。 它允许通过http服务您机器中的任何目录。 它基于python著名的simplehttpserver,它只依赖于 Python2.7解释器和标准库。
与SimpleHTTPServer相反,此开发Web服务器:
- 允许将服务文件夹作为第一个位置参数传递。 默认为当前目录。
- 如果服务文件夹被删除,将以404响应;而不是崩溃。
- 如果重新创建文件夹,将返回正常操作。 对于执行干净操作的构建系统非常有用。
- 如果开发时必须使用安全性,则可以指定绑定IP。
与SimpleHTTPServer一样,此Web服务器可以:
- 指定绑定端口。
- 列出目录。
- 自动将index.html或index.html作为目录项。
安装
pip install webdev
用法
$ webdev --help usage: webdev [-h] [-v] [--version] [-i IP] [-p PORT] [-f] [-r RANGE] [-u] [path] Development Web Server positional arguments: path Path to serve. Default: Current directory. optional arguments: -h, --help show this help message and exit -v, --verbose Increase verbosity level --version show program's version number and exit -i IP, --ip IP IP to bind to. Default: 0.0.0.0 -p PORT, --port PORT Port to listen to. Default: 8080. -f, --force-port Force the use of the given port. -r RANGE, --range RANGE Number of ports to try from the base port -u, --future Ignore if the folder to server doesn't exists yet
变更日志
1.1.0
new
- 增加了对python 3的支持(第5版)。
- 增加了对增量自动端口选择的支持(问题2)。 添加了允许Web服务器为不存在的服务 文件夹,假设它将在将来创建(第3期)。
已更改
- ctrl+c现在被处理(问题4)。
1.0.0
- 初次发布
许可证
Copyright (C) 2015-2016 Carlos Jenkins <carlos@jenkins.co.cr> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.