Fix the PR from earlier.
This commit is contained in:
parent
32cad6847c
commit
9c87b660b8
1 changed files with 8 additions and 12 deletions
10
server.py
10
server.py
|
@ -18,7 +18,7 @@ from modules import render
|
||||||
CSS = "https://zortazert.codeberg.page/style/styles.css"
|
CSS = "https://zortazert.codeberg.page/style/styles.css"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if os.path.exists("config.json"):
|
|
||||||
with open("config.json","r") as f:
|
with open("config.json","r") as f:
|
||||||
srvConfig = json.load(f)
|
srvConfig = json.load(f)
|
||||||
ADDRESS = srvConfig["address"]
|
ADDRESS = srvConfig["address"]
|
||||||
|
@ -29,17 +29,13 @@ except:
|
||||||
newConfig.write("""{
|
newConfig.write("""{
|
||||||
"INFO" : "You would be better off setting address to the full URL of the FreeCompetitors instance.",
|
"INFO" : "You would be better off setting address to the full URL of the FreeCompetitors instance.",
|
||||||
"address" : "/",
|
"address" : "/",
|
||||||
"port" : "8080",
|
"port" : 8080,
|
||||||
"css" : "https://zortazert.codeberg.page/style/styles.css"
|
"css" : "https://zortazert.codeberg.page/style/styles.css"
|
||||||
}""")
|
}""")
|
||||||
newConfig.close
|
newConfig.close
|
||||||
print("Please edit the configuration file \"config.json\".")
|
print("Please edit the configuration file \"config.json\".")
|
||||||
exit()
|
exit()
|
||||||
try:
|
|
||||||
PORT = int(PORT)
|
|
||||||
except:
|
|
||||||
print("Port should be a number")
|
|
||||||
exit()
|
|
||||||
|
|
||||||
# Who fucking made this http.server so I need to use classes?
|
# Who fucking made this http.server so I need to use classes?
|
||||||
# I fucking hate who ever thought that it was a good idea...
|
# I fucking hate who ever thought that it was a good idea...
|
||||||
|
|
Loading…
Reference in a new issue