diff --git a/main.py b/main.py index d1b7800..2879b10 100644 --- a/main.py +++ b/main.py @@ -88,15 +88,64 @@ def api_info(): 'endpoints': { '/': 'GET - Frontend interface or API information', '/api': 'GET - API information (JSON)', + '/docs': 'GET - API documentation (Swagger UI)', '/detect': 'POST - Upload image for memory module detection', '/detect/hardcoded': 'GET - Process hardcoded test image', '/detect/base64': 'POST - Process base64 encoded image', '/health': 'GET - Health check' }, 'model_loaded': detector.model is not None, - 'supported_formats': list(ALLOWED_EXTENSIONS) + 'supported_formats': list(ALLOWED_EXTENSIONS), + 'swagger_ui': 'http://localhost:5003/docs/ (run: python3 api_docs.py)' }) +@app.route('/docs') +def api_docs(): + """Redirect to API documentation.""" + return """ + + +
+Interactive Swagger UI documentation for all API endpoints
+ +python3 api_docs.pyhttp://localhost:5003/docs/
+