Commit cdefb5ce authored by vertighel's avatar vertighel
Browse files

feat: GET /api/cameras — espone cameras.ini come JSON



Nuovo endpoint che restituisce l'intero cameras.ini come oggetto
{cam_id: {role, station, fits_path, ...}} per uso lato client.

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 05d2505e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -73,6 +73,20 @@ for section in ends.sections():
        dynamic_import(section)

        
_CAMERAS_INI = Path(__file__).parent.parent / 'config' / 'cameras.ini'


@api_blueprint.route('/cameras')
async def api_cameras():
    """Return the full cameras.ini as a JSON object keyed by cam_id."""
    cfg = configparser.ConfigParser()
    cfg.read(_CAMERAS_INI)
    return jsonify({
        cam_id: dict(cfg[cam_id])
        for cam_id in cfg.sections()
    })


@api_blueprint.route('/')
async def api_catalog():
    """