Coverage for src\zapy\api\server.py: 100%

1 from datetime import datetime

2

3 import socketio

4

5 from .exceptions import global_error_handler

6 from .deps.socketio import sio

7

8 from . import v1 as api_v1

9

10 from fastapi import FastAPI, APIRouter

11

12

13 app = FastAPI()

14 app.state.application_start_time = datetime.now()

15 app.add_exception_handler(Exception, global_error_handler)

16

17 app_v1 = APIRouter()

18 app_v1.include_router(api_v1.api_server_v1)

19 app_v1.include_router(api_v1.api_store_v1)

20 app_v1.include_router(api_v1.api_request_v1)

21

22 app.include_router(app_v1, prefix='/v1')

23

24 server = socketio.ASGIApp(sio, app)