There was an error while loading. Please reload this page.
1 parent bee67c8 commit 6d51849Copy full SHA for 6d51849
api/index.py
@@ -30,8 +30,11 @@ class handler(BaseHTTPRequestHandler):
30
31
def do_GET(self):
32
path = self.path
33
+ pathreg = re.compile(r'/api?(.*?)')
34
+ user = pathreg.findall(path)[0]
35
+ data = getdata(user)
36
self.send_response(200)
- self.send_header('Content-type','text/plain')
37
+ self.send_header('Content-type','application/json')
38
self.end_headers()
- self.wfile.write(path.encode('utf-8'))
39
+ self.wfile.write(json.dumps(data).encode('utf-8'))
40
return
0 commit comments