Skip to content

Commit

Permalink
spliting up person object and allowing cors
Browse files Browse the repository at this point in the history
  • Loading branch information
cfriedlander committed Dec 31, 2021
1 parent b457040 commit 74980c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synapse/chagai/chagai_location/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, config):

def render_GET(self, request: Request):
request.setHeader(b"Content-Type", b"application/json")
request.setHeader(b"Access-Control-Allow-Origin", b"*")

cookies_file = '/data/google.com_cookies.txt'
google_email = 'chagai95@gmail.com'
Expand All @@ -22,7 +23,7 @@ def render_GET(self, request: Request):
nickname = "Chagai"

person = service.get_person_by_nickname(nickname)
return json.dumps({"person": person}).encode("ascii")
return json.dumps({"accuracy": person.accuracy, "address": person.address, "battery_level": person.battery_level, "charging": person.charging, "latitude": person.latitude, "longitude": person.longitude, "datetime": person.datetime, "timestamp": person.timestamp}).encode("ascii")


class DemoModule:
Expand Down

0 comments on commit 74980c3

Please sign in to comment.