chore(P14-8): 完成运营化与验收收口
这个提交包含在:
@@ -0,0 +1,26 @@
|
||||
const fs = require("fs");
|
||||
const { buildApp } = require("../src/app");
|
||||
|
||||
async function main() {
|
||||
process.env.NODE_ENV = "development";
|
||||
process.env.OPENAPI_DOCS_ENABLED = "true";
|
||||
|
||||
const app = await buildApp();
|
||||
await app.ready();
|
||||
|
||||
const openapiObj = app.swagger();
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const outIndex = args.indexOf("--out");
|
||||
const outPath = outIndex !== -1 ? args[outIndex + 1] : "/tmp/openapi.json";
|
||||
|
||||
fs.writeFileSync(outPath, JSON.stringify(openapiObj, null, 2), "utf8");
|
||||
console.log(`OpenAPI schema exported to ${outPath}`);
|
||||
|
||||
await app.close();
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户