"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebServer = void 0;
var express = require("express");
var socket_io_1 = require("socket.io");
var http_1 = require("http");
var PREFIX = '[WebServer]';
var WebServer = /** @class */ (function () {
    function WebServer(Main) {
        this._Main = Main;
        this.prepare();
    }
    WebServer.prototype.prepare = function () {
        this.app = express();
        this.httpServer = (0, http_1.createServer)(this.app);
        this.socket = new socket_io_1.Server(this.httpServer);
    };
    WebServer.prototype.listen = function () {
        var _this = this;
        return new Promise(function (resolve) {
            var port = _this._Main.Config.webServer.port;
            _this.httpServer.listen(port, function () {
                console.log(PREFIX, "Listening on port http://127.0.0.1:".concat(port));
                resolve();
            });
        });
    };
    return WebServer;
}());
exports.WebServer = WebServer;
//# sourceMappingURL=WebServer.js.map