add main page and multiple stories
This commit is contained in:
@@ -5,17 +5,21 @@ app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def game():
|
||||
def mainPage():
|
||||
return open("main.html").read()
|
||||
|
||||
@app.route("/<path:path>")
|
||||
def game(path):
|
||||
if "Discord" not in str(request.user_agent):
|
||||
return mainPage()
|
||||
gamecode = request.args.get('code')[:-1]
|
||||
|
||||
#return open("page copy.html", "r").read()
|
||||
#print(buildHTML(gamecode))
|
||||
|
||||
return buildHTML(gamecode)
|
||||
gameName = request.path[1:]
|
||||
print(gameName)
|
||||
return buildHTML(gamecode,gameName)
|
||||
|
||||
|
||||
def buildHTML(gamecode):
|
||||
with open("story.json", "r") as f:
|
||||
def buildHTML(gamecode, gameName):
|
||||
with open("stories/" + gameName.replace(".", "") + ".json", "r") as f:
|
||||
print("\n\n")
|
||||
story = json.loads(f.read())
|
||||
nodeName = "start"
|
||||
|
||||
Reference in New Issue
Block a user