Spaces:
Sleeping
Sleeping
Evilmass
commited on
Commit
·
60daf25
1
Parent(s):
7a674f8
router add 404
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
| 2 |
from pydantic import BaseModel
|
| 3 |
|
| 4 |
app = FastAPI()
|
|
@@ -21,18 +23,28 @@ class SystemInfo(BaseModel):
|
|
| 21 |
|
| 22 |
|
| 23 |
@app.get("/")
|
| 24 |
-
def
|
| 25 |
return {"Hello": "World!"}
|
| 26 |
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
@app.get("/systems/EAR-B-WW/00001/system.json", response_model=SystemInfo)
|
| 29 |
async def read_system_info():
|
| 30 |
"""
|
| 31 |
-
https://evi0mo-hf-fastapi.hf.space/docs
|
| 32 |
https://evi0mo-hf-fastapi.hf.space/systems/EAR-B-WW/00001/system.json
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
"""
|
| 37 |
return SystemInfo(
|
| 38 |
json_ver="1.0.2",
|
|
@@ -40,12 +52,12 @@ async def read_system_info():
|
|
| 40 |
revision="00001",
|
| 41 |
api_timeout=30000,
|
| 42 |
mtm=" https://evi0mo-hf-fastapi.hf.space",
|
|
|
|
| 43 |
mtms="https://mtms.rebe.capcom.com",
|
| 44 |
mmr="https://mmr.rebe.capcom.com",
|
| 45 |
-
tmr=" https://evi0mo-hf-fastapi.hf.space/v1/projects/earth-analysis-obt/topics/analysis-client-log:publish",
|
| 46 |
nkm="https://nkm.rebe.capcom.com",
|
| 47 |
wlt="https://wlt.rebe.capcom.com",
|
| 48 |
selector="https://selector.gs.capcom.com",
|
| 49 |
working_state="alive",
|
| 50 |
-
custom_property="
|
| 51 |
)
|
|
|
|
| 1 |
+
# https://evi0mo-hf-fastapi.hf.space/docs
|
| 2 |
+
|
| 3 |
+
from fastapi import FastAPI, status
|
| 4 |
from pydantic import BaseModel
|
| 5 |
|
| 6 |
app = FastAPI()
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
@app.get("/")
|
| 26 |
+
def root():
|
| 27 |
return {"Hello": "World!"}
|
| 28 |
|
| 29 |
|
| 30 |
+
@app.get("/MultiplayerServer/ListPartyQosServers")
|
| 31 |
+
def multiplayer():
|
| 32 |
+
return status.HTTP_404_NOT_FOUND
|
| 33 |
+
|
| 34 |
+
|
| 35 |
@app.get("/systems/EAR-B-WW/00001/system.json", response_model=SystemInfo)
|
| 36 |
async def read_system_info():
|
| 37 |
"""
|
|
|
|
| 38 |
https://evi0mo-hf-fastapi.hf.space/systems/EAR-B-WW/00001/system.json
|
| 39 |
|
| 40 |
+
custom_property
|
| 41 |
+
{"obt_info":{"env":1,"start_time":1730428200,"end_time":1730989200},"qa3":{"api":"https://server.mhwee.com","notify":"wss://server.mhwee.com"}}
|
| 42 |
+
eyJvYnRfaW5mbyI6eyJlbnYiOjEsInN0YXJ0X3RpbWUiOjE3MzA0MjgyMDAsImVuZF90aW1lIjoxNzMwOTg5MjAwfSwicWEzIjp7ImFwaSI6Imh0dHBzOi8vc2VydmVyLm1od2VlLmNvbSIsIm5vdGlmeSI6IndzczovL3NlcnZlci5taHdlZS5jb20ifX0=
|
| 43 |
+
{"obt_info":{"env":1,"start_time":1730428200,"end_time":1730989200},"qa3":{"api":"","notify":""}}
|
| 44 |
+
eyJvYnRfaW5mbyI6eyJlbnYiOjEsInN0YXJ0X3RpbWUiOjE3MzA0MjgyMDAsImVuZF90aW1lIjoxNzMwOTg5MjAwfSwicWEzIjp7ImFwaSI6IiIsIm5vdGlmeSI6IiJ9fQ==
|
| 45 |
+
startup
|
| 46 |
+
gunicorn --certfile=cert.pem --keyfile=key.pem --bind 0.0.0.0:443 app:app
|
| 47 |
+
uvicorn main:app --host 0.0.0.0 --port 443 --ssl-certfile cert.pem --ssl-keyfile key.pem
|
| 48 |
"""
|
| 49 |
return SystemInfo(
|
| 50 |
json_ver="1.0.2",
|
|
|
|
| 52 |
revision="00001",
|
| 53 |
api_timeout=30000,
|
| 54 |
mtm=" https://evi0mo-hf-fastapi.hf.space",
|
| 55 |
+
tmr=" https://evi0mo-hf-fastapi.hf.space/v1/projects/earth-analysis-obt/topics/analysis-client-log:publish",
|
| 56 |
mtms="https://mtms.rebe.capcom.com",
|
| 57 |
mmr="https://mmr.rebe.capcom.com",
|
|
|
|
| 58 |
nkm="https://nkm.rebe.capcom.com",
|
| 59 |
wlt="https://wlt.rebe.capcom.com",
|
| 60 |
selector="https://selector.gs.capcom.com",
|
| 61 |
working_state="alive",
|
| 62 |
+
custom_property="eyJvYnRfaW5mbyI6eyJlbnYiOjEsInN0YXJ0X3RpbWUiOjE3MzA0MjgyMDAsImVuZF90aW1lIjoxNzMwOTg5MjAwfSwicWEzIjp7ImFwaSI6IiIsIm5vdGlmeSI6IiJ9fQ==",
|
| 63 |
)
|