cn-py-serv/config.py

29 lines
778 B
Python
Raw Normal View History

2024-07-03 14:15:22 +03:00
import os
import logging
from server.urlhandler import path
import testmod
2023-12-29 02:13:10 +03:00
SETUP = {
"setup": {
"log_to_file": False,
"log_level": logging.DEBUG
},
2023-12-29 02:13:10 +03:00
"server": {
"port": 8080,
}
}
if SETUP["setup"]["log_to_file"]:
2024-07-03 14:15:22 +03:00
logging.basicConfig(filename=os.path.join(os.getcwd(), "log", "main.log"), filemode="a", encoding="UTF-8",
level=SETUP["setup"]["log_level"],
format="[%(name)s][%(asctime)s][%(levelname)s] %(message)s")
else:
logging.basicConfig(encoding="UTF-8", level=SETUP["setup"]["log_level"],
format="[%(name)s][%(asctime)s][%(levelname)s] %(message)s")
urls = [
path("/", "static-file", "index.html"),
path("/func", "function", testmod.work)
]