tachijs
Version:
Highly testable dead simple web server written in Typescript
19 lines • 622 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseResult_1 = require("./BaseResult");
class EndResult extends BaseResult_1.BaseResult {
constructor(data, encoding, status = 200) {
super();
this.data = data;
this.encoding = encoding;
this.status = status;
}
async execute(req, res, next) {
if (this.encoding != null) {
return res.status(this.status).end(this.data, this.encoding);
}
return res.status(this.status).end(this.data);
}
}
exports.EndResult = EndResult;
//# sourceMappingURL=EndResult.js.map