startup-log.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const ROUTE_LOG_LINES = [
  2. ' GET /api/health — 健康检查',
  3. ' GET /api/whisper/status — Whisper 可用性',
  4. ' POST /api/whisper/transcribe — 语音转文字',
  5. ' GET /api/manifest — 获取视频清单',
  6. ' PUT /api/manifest/:videoId — 更新视频信息',
  7. ' POST /api/manifest — 添加视频条目',
  8. ' GET /api/files/whisper/:id — Whisper 输出文件',
  9. ' GET /api/files/read?path= — 读取项目文件',
  10. ' POST /api/upload/video — 上传视频文件',
  11. ' POST /api/remix/extract-audio — 提取视频音频',
  12. ' POST /api/remix/upload-asset — 上传重塑素材到 Parse',
  13. ' POST /api/download/video — 下载远程视频到本地库',
  14. ' GET /api/download/video/:id — 查询下载任务进度',
  15. ' ---',
  16. ' GET /api/tasks — 获取任务列表',
  17. ' POST /api/tasks — 创建任务',
  18. ' PUT /api/tasks/:id — 更新任务',
  19. ' DEL /api/tasks/:id — 删除任务',
  20. ' ---',
  21. ' GET /api/history — 获取历史记录',
  22. ' POST /api/history — 添加历史',
  23. ' DEL /api/history/:id — 删除历史',
  24. ' DEL /api/history — 清空历史',
  25. ' ---',
  26. ' GET /api/results — 获取结果',
  27. ' POST /api/results — 添加结果',
  28. ' PUT /api/results/:id — 更新结果',
  29. ' DEL /api/results/:id — 删除结果',
  30. ' ---',
  31. ' POST /api/llm/chat — LLM 对话(OpenAI格式)',
  32. ' POST /api/llm/gemini — Gemini 媒体识别'
  33. ];
  34. function printStartupLog({ port, projectRoot }) {
  35. console.log('');
  36. console.log('========================================');
  37. console.log(` 🚀 后端服务已启动: http://localhost:${port}`);
  38. console.log(` 📁 项目根目录: ${projectRoot}`);
  39. console.log(' 📋 接口列表:');
  40. for (const line of ROUTE_LOG_LINES) {
  41. console.log(line);
  42. }
  43. console.log('========================================');
  44. console.log('');
  45. }
  46. module.exports = { printStartupLog };