- 50个后端模块用git mv移入core/与domains/<领域>/,入口server.js、launch.js、restore.js及server/原位不动 - 所有require路径由脚本按新旧位置统一换算(后端、server/、测试) - 新增test/app-paths.test.js,锁定默认数据目录、public目录与飞书配置文件的绝对位置 - 维护与部署.md补充目录说明并更新模块路径 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
428 B
JavaScript
10 lines
428 B
JavaScript
'use strict';
|
|
const { fail } = require('../core/ledger');
|
|
const send = (res, status, data, contentType = 'application/json; charset=utf-8') => {
|
|
res.writeHead(status, { 'Content-Type': contentType });
|
|
res.end(contentType.startsWith('application/json') ? JSON.stringify(data) : data);
|
|
};
|
|
const notFound = () => fail('地址不存在', 404);
|
|
const HTML = 'text/html; charset=utf-8';
|
|
module.exports = { send, notFound, HTML };
|