Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
@@ -8,11 +8,11 @@ def home():
|
|
8 |
return '''true'''
|
9 |
@app.route("/get_states")
|
10 |
def get():
|
11 |
-
states = os.listdir("states")
|
12 |
states_parse = []
|
13 |
for s in states:
|
14 |
-
states_parse.append({"id":s, "text":open(f"states/{s}/text", "r").read()})
|
15 |
return json.dumps(states_parse)
|
16 |
@app.route("/states/<ide>/image.png")
|
17 |
def get_image(ide):
|
18 |
-
return send_file(f"states/{ide}/image.png")
|
|
|
8 |
return '''true'''
|
9 |
@app.route("/get_states")
|
10 |
def get():
|
11 |
+
states = os.listdir("./states")
|
12 |
states_parse = []
|
13 |
for s in states:
|
14 |
+
states_parse.append({"id":s, "text":open(f"./states/{s}/text", "r").read()})
|
15 |
return json.dumps(states_parse)
|
16 |
@app.route("/states/<ide>/image.png")
|
17 |
def get_image(ide):
|
18 |
+
return send_file(f"./states/{ide}/image.png")
|