Files
vless-api/api/example.js
aixianling 18eb590629 feat(api): 实现 API 路由自动加载并优化路由处理
- 新增 api/example.js 文件作为示例 POST API
- 在 app.js 中添加(bodyParser) 中间件
- 实现 loadAPIRoutes 函数自动加载 API 路由
- 更新 JWT 中间件配置,保护 /login 路由
- 优化路由定义,使用箭头函数
2025-02-24 17:46:27 +08:00

7 lines
130 B
JavaScript

// api/example.js
module.exports = (ctx) => {
ctx.body = {
message: 'Example POST API',
data: ctx.request.body
};
};