UNPKG

@shuangren/share-api

Version:

api api-documentation swagger swagger-ui swagger-api openapi api-docs api-documentation-tool api-doc api-docs-generato

22 lines (21 loc) 471 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fs = require("fs"); var conf = require("./config"); exports.default = (function (ctx) { try { fs.writeFileSync(conf.dataPath, JSON.stringify(ctx.request.body)); } catch (e) { ctx.body = { code: 400, data: false, msg: e.message }; return; } ctx.body = { code: 200, data: true }; });