TechDev commited on
Commit
579c41f
·
verified ·
1 Parent(s): 67441bb

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
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")