Mercurial > personal > weather-server
comparison weather_server/server.py @ 4:e7c8dcc5fc15
Make the weather server pip-installable and locally runnable.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 29 Sep 2019 15:10:18 -0400 |
parents | b42c4bfe57c7 |
children | 368f732f13d0 |
comparison
equal
deleted
inserted
replaced
3:b42c4bfe57c7 | 4:e7c8dcc5fc15 |
---|---|
1 import hmac | |
2 | |
1 import bson | 3 import bson |
2 import flask | 4 import flask |
3 import hmac | |
4 | 5 |
5 from . import common | 6 from . import common |
6 from . import locations | 7 from . import locations |
7 from . import types | 8 from . import types |
8 | 9 |
63 location=loc, | 64 location=loc, |
64 last_reading=last_reading, | 65 last_reading=last_reading, |
65 date=date) | 66 date=date) |
66 | 67 |
67 return app | 68 return app |
69 | |
70 | |
71 def main(argv): | |
72 """Main function for a simple local demo.""" | |
73 app = server.build_app(argv[0]) | |
74 app.run(host='0.0.0.0') | |
75 | |
76 | |
77 if __name__ == '__main__': | |
78 main(sys.argv[1:]) |