"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const HttpServer_1 = require("./HttpServer");
const HotReloadServer_1 = require("./HotReloadServer");
const path = require("path");
class Previewer {
    constructor(options) {
        this.httpServer = null;
        this.hotReloadServer = null;
        this.defaultFrontendLocation = path.join(__dirname, '../frontend/preview');
        this.init(options);
    }
    init(options) {
        /* tslint:disable */
        this.initServer(options);
    }
    async initServer(options) {
        this.httpServer = new HttpServer_1.default({
            root: options.staticSourceLocation || this.defaultFrontendLocation,
            cache: '-1',
            showDir: true,
            autoIndex: true,
        });
        await this.httpServer.listen(options.port);
        this.hotReloadServer = new HotReloadServer_1.default({
            port: options.wsport,
        });
    }
}
exports.Previewer = Previewer;
//# sourceMappingURL=index.js.map