diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-21 23:29:10 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-21 23:29:10 +0300 |
| commit | d25708b978b50c905b062eb8ba3970e48ae276e8 (patch) | |
| tree | cabb9f355cf557939147c32670d42f024aa816b8 | |
| parent | 3526314e0af5331ac25435d93ab225c37c6e62dc (diff) | |
Split server and prediction files
| -rw-r--r-- | Pipfile | 2 | ||||
| -rw-r--r-- | Procfile | 2 | ||||
| -rw-r--r-- | iss/__init__.py | 0 | ||||
| -rw-r--r-- | iss/predictions.py (renamed from iss.py) | 10 | ||||
| -rw-r--r-- | iss/server.py | 8 |
5 files changed, 10 insertions, 12 deletions
@@ -12,7 +12,7 @@ fastapi = "*" uvicorn = "*" [scripts] -server = "uvicorn iss:app" +server = "uvicorn iss.server:app" [requires] python_version = "3.8" @@ -1 +1 @@ -web: uvicorn iss:app --host=0.0.0.0 --port=${PORT} +web: uvicorn iss.server:app --host=0.0.0.0 --port=${PORT} diff --git a/iss/__init__.py b/iss/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/iss/__init__.py diff --git a/iss.py b/iss/predictions.py index 215b7c3..fa4aeff 100644 --- a/iss.py +++ b/iss/predictions.py @@ -1,4 +1,3 @@ -from fastapi import FastAPI from skyfield.api import Topos, load TEL_AVIV = Topos('32.0853 N', '34.7817 E') @@ -22,12 +21,3 @@ def get_predictions(location=TEL_AVIV, satellite_name=ISS): name = ('rise above 30°', 'culminate', 'set below 30°')[event] print(ti) print(ti.utc_strftime('%Y %b %d %H:%M:%S'), name) - - - -app = FastAPI() - - -@app.get("/") -async def root(): - return {"message": "Hello World"} diff --git a/iss/server.py b/iss/server.py new file mode 100644 index 0000000..ee60be1 --- /dev/null +++ b/iss/server.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Hello World"} |
