"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serveCommand = void 0;
const app_1 = require("../app");
exports.serveCommand = {
    command: ['serve'],
    describe: 'run torrent stream server',
    builder: {
        config: {
            type: 'string',
            alias: 'c',
            desc: 'path to JSON config',
        },
    },
    async handler({ config }) {
        try {
            await app_1.setup({
                configFile: config,
            });
        }
        catch (err) {
            console.error(String(err));
            process.exit(1);
        }
    },
};
