o
    hl                     @   s   d dl mZmZ ddlmZmZ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Zd d	lmZ ejjed
 e Zejeddgddgdgd eje ddZejdeeddd dd Zee_eej ee	j dS )    )FastAPISecurity   )Baseengineget_db)auth_routeschat_routes)get_openapi)
HTTPBearer)StaticFilesN)CORSMiddleware)bindzhttps://vivedev.usmsystems.comzhttp://localhost:4200T*)Zallow_originsZallow_credentialsZallow_methodsZallow_headersappZglb_avatarsz/glb_avatars)	directory)namec                  C   s   t jrt jS tdddt jd} ddddd	i| d
 d< g d}| d D ]2}||v r@| d | D ]}dg ig| d | | d< q/q#| d | D ]}| d | | dd  qFq#| t _t jS )NzMy APIz1.0.0zAPI with JWT auth)titleversiondescriptionroutesZ
BearerAuthhttpZbearerZJWT)typeschemeZbearerFormat
componentsZsecuritySchemes)z/chat-store/z/chat/z/user-avatar/z/add-user-avatar/z/user-info/z/student-logout/z/clone-fixed/pathssecurity)r   openapi_schemar
   r   pop)r   Zsecure_pathspathmethod r!   &/var/www/html/vive_backend/app/main.pycustom_openapi    s2   	r#   ) Zfastapir   r   Zdatabaser   r   r   r   r   r	   Zfastapi.openapi.utilsr
   Zfastapi.securityr   Zfastapi.staticfilesr   osZfastapi.middleware.corsr   metadataZ
create_allr   Zadd_middlewarer   joingetcwdZGLB_AVATARS_PATHZmountr#   ZopenapiZinclude_routerZrouterr!   r!   r!   r"   <module>   s2   !