UNPKG

@larksuiteoapi/core

Version:
30 lines 739 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Response = exports.Request = void 0; class Request { constructor() { this.headers = {}; this.params = {}; } } exports.Request = Request; class Response { constructor() { this.headers = {}; } writeResponse(res) { res.statusCode = this.statusCode; Object.entries(this.headers).forEach(([k, v]) => { res.setHeader(k, v); }); if (typeof this.body == "string") { res.write(this.body); } else { res.write(JSON.stringify(this.body)); } res.end(); } } exports.Response = Response; //# sourceMappingURL=model.js.map