-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwsgi.py
More file actions
27 lines (20 loc) · 730 Bytes
/
wsgi.py
File metadata and controls
27 lines (20 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3
"""
ASGI entry point for lightning-fast Wikipedia API
This module provides the ASGI application object for production deployment with uvicorn
For production deployment:
uvicorn wsgi:application --host 127.0.0.1 --port 8000 --workers 8
Or with gunicorn + uvicorn workers:
gunicorn wsgi:application -k uvicorn.workers.UvicornWorker --bind 127.0.0.1:8000 --workers 8
"""
import os
import sys
# Add the application directory to Python path
sys.path.insert(0, '/var/www/wikipedia-api')
# Import the FastAPI application
from wikipedia_api_lightning import app
# ASGI application object
application = app
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)