@node-server/renderer
Version:
NodeServerJs is a library with standard feature implemented for web and api
34 lines (33 loc) • 949 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Api = /** @class */ (function () {
function Api() {
}
return Api;
}());
exports.Api = Api;
var ApiResponse = /** @class */ (function () {
function ApiResponse() {
this.error = true;
this.result = {};
this.status = 404;
}
ApiResponse.prototype.setError = function (res, stat) {
this.error = true;
this.result = res;
this.status = stat;
};
ApiResponse.prototype.setSuccess = function (res) {
this.error = false;
this.result = res;
this.status = 200;
};
return ApiResponse;
}());
exports.ApiResponse = ApiResponse;
var ApiType;
(function (ApiType) {
ApiType[ApiType["JS"] = 0] = "JS";
ApiType[ApiType["SQL"] = 1] = "SQL";
ApiType[ApiType["TS"] = 2] = "TS";
})(ApiType = exports.ApiType || (exports.ApiType = {}));