Running FastAPI and Flask Web Services with Uvicorn/Gunicorn // NodeFlux Docs
Deploy high-performance Python web applications and REST APIs using ASGI/WSGI production servers. ## Steps 1. For FastAPI: install fastapi and uvicorn in requirements.txt. 2. For Flask: install flask and gunicorn in requ NodeFlux documentation for free Minecraft, Node.js and application hosting.
Deploy high-performance Python web applications and REST APIs using ASGI/WSGI production servers. ## Steps 1. For FastAPI: install fastapi and uvicorn in requirements.txt. 2. For Flask: install flask and gunicorn in requ
Deploy high-performance Python web applications and REST APIs using ASGI/WSGI production servers. ## Steps 1. For FastAPI: install fastapi and uvicorn in requirements.txt. 2. For Flask: install flask and gunicorn in requirements.txt. 3. Read PORT environment variable: port = int(os.environ.get("PORT", 8000)). 4. For FastAPI, set uvicorn entry point: uvicorn.run("main:app", host="0.0.0.0", port=port). 5. For Flask, set gunicorn start command: gunicorn -w 2 -b 0.0.0.0:$PORT main:app. 6. Upload project files to your NodeFlux Python service. 7. Start service and test web endpoints using your assigned host IP and port. ## Notes - Binding to 0.0.0.0 is required so container port mapping routes traffic to Python web workers. - FastAPI natively generates interactive OpenAPI /docs documentation endpoints automatically.