def do_GET(self):
matches = re.match(PATH_REGEX, self.path)
if matches:
path = matches.group(1)
elif self.path == '/web/' and self.server.apiGatewayClientUrl != None:
f = open("web/index.html")
html = f.read()
f.close()
html = html.replace('src="apiGateway-js-sdk/','src="'+self.server.apiGatewayClientUrl+'/apiGateway-js-sdk/')
self.respond(200,html)
return
else:
return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
#return super(MyHandler,self).do_GET()
#self.respond(404, "Not Found")
#return
try:
page = self.server.serverIface.getPage('<httpserver>', path)
self.respond(200, page["html"])
except custom_exceptions.NotFound:
self.respond(404, "Not Found")
except:
self.respond(500, "Internal Error")
评论列表
文章目录