File size: 1,038 Bytes
95a7280
 
 
3164c55
32989ce
dee0729
f82269d
95a7280
 
 
eb21184
 
5b595ef
95a7280
 
 
 
78d4065
 
 
 
 
95a7280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb21184
 
 
 
 
95a7280
 
 
 
 
dee0729
32989ce
9ab0bfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from fastapi import FastAPI

from fastapi.middleware.gzip import GZipMiddleware

from .TTS.TTSRoutes import tts_router
from .Embedding.EmbeddingRoutes import embeddigs_router


from fastapi.middleware.cors import CORSMiddleware

from fastapi_cache import FastAPICache
from fastapi_cache.backends.inmemory import InMemoryBackend

import logging


# Configure logging
# logging.basicConfig(
#     level=logging.DEBUG,
#     format="%(asctime)s - %(levelname)s - %(message)s",
#     datefmt="%Y-%m-%d %H:%M:%S",
# )


app = FastAPI()
origins = ["*"]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
app.add_middleware(GZipMiddleware, minimum_size=1000)


@app.on_event("startup")
async def startup():
    FastAPICache.init(InMemoryBackend())


@app.get("/")
async def landing_page():
    return {"code": 200, "message": "we are back!"}


app.include_router(embeddigs_router)
app.include_router(tts_router)
# app.include_router(shader_router)