27 lines
488 B
Python
27 lines
488 B
Python
# source: https://djitellopy.readthedocs.io/en/latest/tello/
|
|
|
|
import sys
|
|
import time
|
|
|
|
from fastapi import FastAPI
|
|
import uvicorn
|
|
|
|
from routes.base import api_router
|
|
|
|
|
|
|
|
def start_application():
|
|
app = FastAPI()
|
|
app.include_router(api_router)
|
|
return app
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) == 1:
|
|
port = 8889
|
|
else:
|
|
port = int(sys.argv[1])
|
|
|
|
app = start_application()
|
|
uvicorn.run(app, host="0.0.0.0", port=port, log_level="debug")
|