"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initWs = void 0;
const interface_1 = require("./model/interface");
const app_1 = require("./app");
const services_ws_1 = require("./services/services-ws");
const interface_2 = require("../webpack/model/interface");
function initWs(options) {
    const mergeOptions = Object.assign(Object.assign({}, interface_1.defaultConfigWs), options);
    const mergeWebPack = Object.assign(Object.assign({}, interface_2.defaultConfig), mergeOptions);
    if (!!(options === null || options === void 0 ? void 0 : options.puppeteerOptions)) {
        mergeWebPack.puppeteerOptions = Object.assign(Object.assign({}, interface_2.defaultConfig.puppeteerOptions), options.puppeteerOptions);
    }
    const app = (0, app_1.appExpress)(mergeOptions);
    new services_ws_1.ServiceWs(app, mergeOptions);
    app.listen(mergeOptions.port, () => {
        console.log(`Web service on http://localhost:${mergeOptions.port}`);
    });
}
exports.initWs = initWs;
//# sourceMappingURL=init-ws.js.map