2016-07-06 06:30:33 +00:00
|
|
|
"use strict";
|
|
|
|
var plugins = require("./smartnginx.plugins");
|
|
|
|
var paths = require("./smartnginx.paths");
|
|
|
|
var snippets = require("./smartnginx.snippets");
|
|
|
|
(function (zoneTypes) {
|
|
|
|
zoneTypes[zoneTypes["reverseProxy"] = 0] = "reverseProxy";
|
|
|
|
zoneTypes[zoneTypes["static"] = 1] = "static";
|
|
|
|
})(exports.zoneTypes || (exports.zoneTypes = {}));
|
|
|
|
var zoneTypes = exports.zoneTypes;
|
|
|
|
var NginxZone = (function () {
|
|
|
|
function NginxZone(optionsArg) {
|
2016-07-08 02:24:07 +00:00
|
|
|
this.zoneName = optionsArg.zoneName;
|
|
|
|
this.type = optionsArg.type;
|
|
|
|
this.destination = optionsArg.destination;
|
2016-07-06 06:30:33 +00:00
|
|
|
this.configString = snippets.getZoneConfigString(optionsArg.zoneName, optionsArg.destination);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
NginxZone.prototype.deploy = function () {
|
|
|
|
var filePath = plugins.path.join(paths.nginxZoneBase, this.zoneName + ".conf");
|
|
|
|
plugins.smartfile.memory.toFsSync(this.configString, filePath);
|
|
|
|
};
|
|
|
|
;
|
|
|
|
return NginxZone;
|
|
|
|
}());
|
|
|
|
exports.NginxZone = NginxZone;
|
|
|
|
;
|
2016-07-08 02:24:07 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRuZ2lueC5jbGFzc2VzLm5naW54em9uZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0bmdpbnguY2xhc3Nlcy5uZ2lueHpvbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFDaEQsSUFBWSxLQUFLLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUU1QyxJQUFZLFFBQV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