cn-py-serv/server/url.py
Иван Солнцев 887e8da01b Add functional to send static files
Add
- internal project file iterator function
- path function to locate user files (first allocate as static-files)
- primitive HTML page files for demonstrate server functional

Change
- Response class as iterator
- code for send response to client
2024-02-25 01:42:17 +03:00

6 lines
277 B
Python

def path(path="/", _type="static-file", _file="index.html", methods=("GET",)):
if _type == "static-file":
return {path: (methods, _type, "static/{}".format(_file))}
elif _type == "template":
return {path: (methods, _type, "template/{}".format(_file))}