Mercurial > personal > weather-server
comparison weather_server/server.py @ 16:9a609bcf0809
Port main script to TypeScript and prepare for serving it.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Sat, 12 Oct 2019 14:03:52 -0400 |
| parents | 52ef21607b31 |
| children | beb42c835c52 |
comparison
equal
deleted
inserted
replaced
| 15:df3e0534c994 | 16:9a609bcf0809 |
|---|---|
| 87 r.as_dict() for r in logger.data | 87 r.as_dict() for r in logger.data |
| 88 if start < r.sample_time | 88 if start < r.sample_time |
| 89 ] | 89 ] |
| 90 resp = flask.Response() | 90 resp = flask.Response() |
| 91 resp.content_type = 'application/json' | 91 resp.content_type = 'application/json' |
| 92 resp.data = common.json_dumps(readings) | 92 resp.data = common.json_dumps({ |
| 93 'timezone': loc.tz_name, | |
| 94 'readings': readings, | |
| 95 }) | |
| 93 return resp | 96 return resp |
| 94 | 97 |
| 95 return app | 98 return app |
| 96 | 99 |
| 97 | 100 |
