"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDebugTargetsRouter = void 0;
const tslib_1 = require("tslib");
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
const debug_targets_1 = require("@/controller/debug-targets");
const getDebugTargetsRouter = () => {
    const router = new koa_router_1.default();
    router.get('/json/version', (ctx) => {
        ctx.body = {
            Browser: 'Hippy/v1.0.0',
            'Protocol-Version': '1.1',
        };
    });
    const getDebugTargets = async (ctx) => {
        const { hash = '' } = ctx.query;
        const rst = await debug_targets_1.DebugTargetManager.getDebugTargets(hash);
        ctx.body = rst;
    };
    router.get('/json', getDebugTargets);
    router.get('/json/list', getDebugTargets);
    return router;
};
exports.getDebugTargetsRouter = getDebugTargetsRouter;
