4 Commits
6 changed files with 1369 additions and 3 deletions
+3
View File
@@ -11,3 +11,6 @@ static/*
.DS_Store .DS_Store
.coverage .coverage
docs/
dist/
+32
View File
@@ -0,0 +1,32 @@
# PyServe configuration for serving documentation
# Usage: pyserve -c config.docs.yaml
http:
static_dir: ./docs
templates_dir: ./templates
server:
host: 0.0.0.0
port: 8000
backlog: 5
default_root: false
ssl:
enabled: false
logging:
level: INFO
console_output: true
extensions:
- type: routing
config:
regex_locations:
"~*\\.(css)$":
root: "./docs"
cache_control: "public, max-age=3600"
"__default__":
root: "./docs"
index_file: "index.html"
cache_control: "no-cache"
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "pyserve" name = "pyserve"
version = "0.7.0" version = "0.7.1"
description = "Simple HTTP Web server written in Python" description = "Simple HTTP Web server written in Python"
authors = [ authors = [
{name = "Илья Глазунов",email = "i.glazunov@sapiens.solutions"} {name = "Илья Глазунов",email = "i.glazunov@sapiens.solutions"}
+1 -1
View File
@@ -2,7 +2,7 @@
PyServe - HTTP web server written on Python PyServe - HTTP web server written on Python
""" """
__version__ = "0.6.0" __version__ = "0.7.0"
__author__ = "Ilya Glazunov" __author__ = "Ilya Glazunov"
from .server import PyServeServer from .server import PyServeServer
+4
View File
@@ -123,6 +123,10 @@ class RequestHandler:
file_path = root / index_file file_path = root / index_file
else: else:
file_path = root / path file_path = root / path
# If path is a directory, look for index file
if file_path.is_dir():
index_file = config.get("index_file", "index.html")
file_path = file_path / index_file
try: try:
file_path = file_path.resolve() file_path = file_path.resolve()
File diff suppressed because it is too large Load Diff