26 lines
No EOL
732 B
Python
Executable file
26 lines
No EOL
732 B
Python
Executable file
#!/usr/bin/env python3
|
|
"""
|
|
Hypercorn ASGI server entry point for production deployment.
|
|
"""
|
|
import asyncio
|
|
from hypercorn.config import Config as HypercornConfig
|
|
from hypercorn.asyncio import serve
|
|
from app import create_app
|
|
from config import Config
|
|
|
|
def main():
|
|
app = create_app()
|
|
|
|
# Configure hypercorn
|
|
config = HypercornConfig()
|
|
config.bind = [f"0.0.0.0:{Config.PORT}"]
|
|
config.workers = 1
|
|
config.access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
|
|
config.accesslog = "-" # stdout
|
|
config.errorlog = "-" # stderr
|
|
|
|
print(f"Starting Veo Video Generator API on port {Config.PORT}")
|
|
asyncio.run(serve(app, config))
|
|
|
|
if __name__ == "__main__":
|
|
main() |