import gradio as gr
import os

from pages import apps, about, crewai

with gr.Blocks() as demo:
    apps.app.render()
with demo.route("About"):
    about.app.render()
with demo.route("CrewAI"):
    crewai.app.render()


if __name__ == "__main__":
    # Get server settings from environment variables or use defaults
    server_name = os.environ.get('GRADIO_SERVER_NAME', '0.0.0.0')
    server_port = int(os.environ.get('GRADIO_SERVER_PORT', '7860'))
    
    demo.launch(
        server_name=server_name,
        server_port=server_port,
        share=False,
        debug=True,
        show_error=True,
        inbrowser=True,
        # mcp_server=True,
    )
