§
    ›JÕfÌ  ã                   óŽ   — d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
mZ  e j        e¦  «        Zdd„Zdd	„Zdefd
„ZdZdS )é    N)ÚFastAPI)ÚCORSMiddleware)Úsettings)Úroot_api_router)ÚHTTPExceptionÚhttp_exception_handlerÚreturnc               ƒ   ó>   K  — t                                d¦  «         dS )z‚Define FastAPI startup event handler.

    Resources:
        1. https://fastapi.tiangolo.com/advanced/events/#startup-event

    z&Execute FastAPI startup event handler.N©ÚlogÚdebug© ó    ú,/var/www/html/chat-with-data/app/__init__.pyÚ
on_startupr      s    è è € õ ‡I‚IÐ6Ñ7Ô7Ð7Ø€Dr   c               ƒ   ó>   K  — t                                d¦  «         dS )z„Define FastAPI shutdown event handler.

    Resources:
        1. https://fastapi.tiangolo.com/advanced/events/#shutdown-event

    z'Execute FastAPI shutdown event handler.Nr   r   r   r   Úon_shutdownr      s    è è € õ ‡I‚IÐ7Ñ8Ô8Ð8Ø€Dr   c                  óà  — t                                d¦  «         t          t          j        t          j        ddigt          j        t          gt          g¬¦  «        } |  	                    t          dgdg d¢dg¬¦  «         t                                d	¦  «         |                      t          ¦  «         t                                d
¦  «         |                      t          t          ¦  «         | S )z)Initialize FastAPI application.
    
    z$Initialize FastAPI application node.Úurlzhttp://127.0.0.1:9000)Útitler   ÚserversÚdocs_urlr   r   Ú*T)ÚGETÚPOSTÚPUTÚDELETEÚOPTIONSÚPATCH)Úallow_originsÚallow_credentialsÚallow_methodsÚallow_headerszAdd application routes.z;Register global exception handler for custom HTTPException.)r   r   r   r   ÚPROJECT_NAMEÚDEBUGÚDOCS_URLr   r   Úadd_middlewarer   Úinclude_routerr   Úadd_exception_handlerr   r   )Úapps    r   Úget_applicationr+   '   sá   € õ
 ‡I‚IÐ4Ñ5Ô5Ð5Ý
ÝÔ#ÝŒnØÐ0Ð1Ð2ÝÔ"Ý<Ý Mðñ ô €Cð ×ÒØeØØJÐJÐJØeð	 ñ ô ð õ ‡I‚IÐ'Ñ(Ô(Ð(Ø×Ò•Ñ'Ô'Ð'Ý‡I‚IÐKÑLÔLÐLØ×ÒmÕ-CÑDÔDÐDà€Jr   )r+   )r	   N)ÚloggingÚfastapir   Úfastapi.middleware.corsr   Ú
app.configr   Ú
app.routerr   Úapp.exceptionsr   r   Ú	getLoggerÚ__name__r   r   r   r+   Ú__all__r   r   r   ú<module>r5      sà   ðØ €€€à Ð Ð Ð Ð Ð Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø Ð Ð Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &ðð ð ð ð ð ð ð ð €gÔ˜Ñ!Ô!€ð	ð 	ð 	ð 	ð	ð 	ð 	ð 	ð˜ð ð ð ð ð8 €€€r   