This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export function GET() {
|
||||
return NextResponse.json({ status: "ok", service: "rednote-tool-studio" });
|
||||
}
|
||||
@@ -6,7 +6,9 @@ export function GET(request: Request) {
|
||||
openapi: "3.1.0",
|
||||
info: { title: "Rednote Tool Studio API", version: "0.1.0", description: "供 Codex 等外部编码代理创建、修改、构建、校验并打包小红书离线 H5 小工具。写操作使用 revision 进行乐观并发控制。" },
|
||||
servers: [{ url: origin }],
|
||||
security: [{ basicAuth: [] }],
|
||||
paths: {
|
||||
"/api/health": { get: { operationId: "health", summary: "无需认证的容器健康检查", security: [], responses: { "200": { description: "服务健康" } } } },
|
||||
"/api/projects": {
|
||||
get: { operationId: "listProjects", summary: "列出项目", responses: { "200": { description: "项目列表" } } },
|
||||
post: { operationId: "createProject", summary: "从模板创建项目", requestBody: { required: true, content: { "application/json": { schema: { type: "object", properties: { name: { type: "string" }, template: { type: "string", default: "basic" } } } } } }, responses: { "201": { description: "已创建" } } },
|
||||
@@ -25,6 +27,7 @@ export function GET(request: Request) {
|
||||
"/api/maintenance/cleanup": { post: { operationId: "cleanupIdleNodeModules", summary: "清理闲置项目 node_modules", requestBody: { content: { "application/json": { schema: { type: "object", properties: { idleHours: { type: "number", minimum: 0, default: 24 } } } } } }, responses: { "200": { description: "清理结果" } } } },
|
||||
},
|
||||
components: {
|
||||
securitySchemes: { basicAuth: { type: "http", scheme: "basic" } },
|
||||
parameters: {
|
||||
ProjectId: { name: "id", in: "path", required: true, schema: { type: "string" } },
|
||||
FilePath: { name: "path", in: "path", required: true, schema: { type: "string" }, description: "项目相对路径,例如 src/App.jsx" },
|
||||
|
||||
Reference in New Issue
Block a user