@@ -46,40 +46,36 @@ def create_app() -> FastAPI:
4646 # Set up error handlers
4747 setup_error_handlers (app )
4848
49+ # Mount static files
50+ app .mount ("/static" , StaticFiles (directory = "src/static" ), name = "static" )
51+
52+ # Include routers
53+ app .include_router (auth .router , prefix = "/api" )
54+ app .include_router (index .router , prefix = "/web" )
55+ app .include_router (s3 .router )
56+
57+ # Health check endpoints
58+ @app .get ("/health" )
59+ async def health_check () -> Dict [str , str ]:
60+ """Health check endpoint for monitoring."""
61+ return {"status" : "healthy" , "timestamp" : get_current_date_time (), "version" : "0.1.0" }
62+
63+ @app .get ("/test" , response_model = Dict [str , str ])
64+ async def test () -> Dict [str , str ]:
65+ """Test endpoint to verify the application is working."""
66+ return {
67+ "result" : "success" ,
68+ "msg" : f"It works! { get_current_date_time ()} " ,
69+ }
70+
71+ # Root endpoint
72+ @app .get ("/" )
73+ async def root () -> Dict [str , str ]:
74+ """Root endpoint with basic application information."""
75+ return {"message" : "Web Service Template API" , "version" : "0.1.0" , "docs" : "/docs" , "health" : "/health" }
76+
4977 return app
5078
5179
5280# Create the application
5381app = create_app ()
54-
55-
56- # Mount static files
57- app .mount ("/static" , StaticFiles (directory = "src/static" ), name = "static" )
58-
59- # Include routers
60- app .include_router (auth .router , prefix = "/api" )
61- app .include_router (index .router , prefix = "/web" )
62- app .include_router (s3 .router )
63-
64-
65- # Health check endpoints
66- @app .get ("/health" )
67- async def health_check () -> Dict [str , str ]:
68- """Health check endpoint for monitoring."""
69- return {"status" : "healthy" , "timestamp" : get_current_date_time (), "version" : "0.1.0" }
70-
71-
72- @app .get ("/test" , response_model = Dict [str , str ])
73- async def test () -> Dict [str , str ]:
74- """Test endpoint to verify the application is working."""
75- return {
76- "result" : "success" ,
77- "msg" : f"It works! { get_current_date_time ()} " ,
78- }
79-
80-
81- # Root endpoint
82- @app .get ("/" )
83- async def root () -> Dict [str , str ]:
84- """Root endpoint with basic application information."""
85- return {"message" : "Web Service Template API" , "version" : "0.1.0" , "docs" : "/docs" , "health" : "/health" }
0 commit comments