
    2Yhi                     D   U d dl Z d dlmZ d dlmZm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mZmZ d d	lmZ  eej*                  ej,                  ej.                  ej0                  
      Zeed<   ej7                  ee       ej7                  ee       ej7                  ee       ej8                  j;                  d      Zej?                  e	eddgdg       d dl m!Z!  e!e       ejE                  d      d        Z#ejE                  d      d        Z$ e         e e jJ                               Z&e&jO                         Z(ejR                  jU                  d      j;                  d      Z+e(e+d    z  Z,ej[                  ej\                   ee,      d       y)    N)Path)FastAPIHTTPException)RequestValidationError)CORSMiddleware)StaticFiles)settings)APIExceptionAPIErrorHandlerHttpErrorHandlerValidationErrorHandler)create_uploads_directory)titledescriptionversiondebugapp,T*)allow_originsallow_credentialsallow_methodsallow_headers)include_routersstartupc                  "   K   t        d       yw)z9
    Anything that needs to be done while app starts
    z*******API STARTED*******Nprint     >/var/www/html/wine-match-dev/backend/winematch-backend/main.pyr   r   +   s     
 

%&   shutdownc                  "   K   t        d       yw)z;
    Anything that needs to be done while app shutdown
    z*******API CLOSED*******Nr   r   r    r!   on_app_shutdownr%   3   s     
 

$%r"   /)	directoryuploads)name)/ospathlibr   fastapir   r   fastapi.exceptionsr   fastapi.middleware.corsr   fastapi.staticfilesr   src.core.configr	   src.core.exceptionsr
   r   r   r   src.utils.ior   	APP_TITLEAPP_DESCRIPTIONAPP_VERSIONDEBUGr   __annotations__add_exception_handlerCORS_ORIGINSsplitoriginsadd_middlewaresrc.core.routerr   on_eventr   r%   getcwdproject_rootresolveproject_root_absoluteUPLOADS_DIRstripuploads_path_partsstatic_root_absolutemountSTATIC_FILES_PATHr   r    r!   <module>rI      s   	  * 5 2 + $ g g 1


((  
..	W    , 8   -)9 :   02H I



%
%c
*   %%   ,   i' ' j& &  IBIIK $,,.  ))//4::3? ,/A!/DD  		./	 
 r    