morphik-core/start_server.py

24 lines
453 B
Python
Raw Normal View History

import uvicorn
from dotenv import load_dotenv
2024-11-22 18:56:22 -05:00
from core.config import get_settings
2024-11-16 14:37:01 -05:00
def main():
# Load environment variables from .env file
load_dotenv()
2024-11-22 18:56:22 -05:00
# Load settings (this will validate all required env vars)
settings = get_settings()
# Start server
uvicorn.run(
"core.api:app",
2024-11-22 18:56:22 -05:00
host=settings.HOST,
port=settings.PORT,
# reload=settings.RELOAD
)
2024-11-22 18:56:22 -05:00
if __name__ == "__main__":
2024-11-16 14:37:01 -05:00
main()