@lottojs/lotto
Version:
Simple, lightweight and dependency-free NodeJS web application framework.
23 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Lotto = void 0;
const router_1 = require("./router/router");
const server_1 = require("./server/server");
class Lotto extends router_1.Router {
constructor(options) {
super();
if (options === null || options === void 0 ? void 0 : options.prefix)
this.prefix = options.prefix;
if (options === null || options === void 0 ? void 0 : options.cors)
this.cors = options.cors;
if (options === null || options === void 0 ? void 0 : options.secureHeaders)
this.secureHeaders = options.secureHeaders;
this.server = new server_1.Server(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.host) ? { host: options.host } : {})), ((options === null || options === void 0 ? void 0 : options.port) ? { port: options.port } : {})));
}
init(after) {
this.server.create((ctx) => this.handle(ctx));
this.server.listen(after);
}
}
exports.Lotto = Lotto;
//# sourceMappingURL=lotto.js.map