Some fixing

This commit is contained in:
Krateng
2018-11-30 16:01:32 +01:00
parent 19dc86d32a
commit 239e0bb729
3 changed files with 14 additions and 5 deletions
+7 -5
View File
@@ -37,18 +37,20 @@ def database_get(pth):
@post("/db/<pth:path>")
def database_post(pth):
response.set_header("Access-Control-Allow-Origin","*")
try:
proxyresponse = urllib.request.urlopen("http://localhost:" + str(DATABASE_PORT) + "/" + pth,request.body)
contents = proxyresponse.read()
response.status = proxyresponse.getcode()
response.content_type = "application/json"
return contents
except HTTPError as e:
contents = ""
response.status = e.code
return
response.content_type = "application/json"
response.set_header("Access-Control-Allow-Origin","*")
return contents
return
@route("/exit")
def shutdown():