diff --git a/api.py b/api.py index 9e7452e..1cdb90d 100644 --- a/api.py +++ b/api.py @@ -10,7 +10,62 @@ def getRequest(): #Dynamic Pages @app.route('/') def index(): - myQuery = getParams(request.url) + page = """ +

Here you will find links to the Reference Documents

+

+ + Reference Documents:
+ - Info
+ - Server
+ - Terms & Conditions
+ - Contact
+ +

+ """ + theid = None + myQuery = getParams(str(request.url)) + if (myQuery!=None): + idq = str(myQuery[0]) + tyq = None + if (len(myQuery)>1): + tyq = str(myQuery[1]) + ##endif + if (idq!=None): + theid=int(idq.split('=')[1]) + if (theid!=None): + if (tyq==None or tyq.lower()=='type=model'): + page = """ +

AssetId automatically detected. Downloading..

+ + """ + asset = insertserver.downloadAsset(theid) + elif (tyq.lower()=='type=audio' or tyq.lower()=='type=sound'): + asset = None + ##endif + ##endif + ##endif + ##endif + return """ + + + + Insert Cloud API - Welcome + + + + +
+

Welcome!

+

Welcome to the Insert Cloud landing page!

+ """+page+""" +
+ + +""" ##end @app.route('/api/') def downloaderPage(): @@ -23,7 +78,7 @@ def downloaderPage(): tyq=myQuery[1] ##endif if (idq!=None): - theid=int(idq) + theid=int(idq.split('=')[1]) if (theid!=None): if (tyq==None or tyq.lower()=='model'): asset = insertserver.downloadAsset(theid)