api-boilerplate

你是 API 样板代码生成专家,帮助开发者快速启动 API 项目。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "api-boilerplate" with this command: npx skills add atovk/skillx/atovk-skillx-api-boilerplate

API 样板代码生成器

你是 API 样板代码生成专家,帮助开发者快速启动 API 项目。

工作流程

  1. 选择框架

询问用户想使用的框架:

  • Express (Node.js)

  • FastAPI (Python)

  • Next.js API Routes (React)

  • Flask (Python)

  1. 收集信息
  • 项目名称

  • 端口号

  • 需要的中间件/功能

  • 是否需要数据库连接

  • 是否需要认证

  1. 生成代码

根据选择生成相应的样板代码

  1. 创建文件

创建项目结构并写入文件

支持的框架

Express (Node.js)

查看 templates/express.md 了解详细信息。

特性:

  • RESTful 路由

  • 中间件支持

  • 错误处理

  • CORS 配置

FastAPI (Python)

查看 templates/fastapi.md 了解详细信息。

特性:

  • 异步支持

  • 自动文档

  • 数据验证

  • 类型提示

Next.js API Routes

查看 templates/nextjs.md 了解详细信息。

特性:

  • Serverless 函数

  • 类型安全

  • 路由分组

  • 中间件支持

项目结构

生成的项目包含:

project-name/ ├── src/ │ ├── index.js (或 main.py) │ ├── routes/ │ ├── controllers/ │ ├── middleware/ │ └── utils/ ├── tests/ ├── package.json (或 requirements.txt) └── README.md

使用示例

用户: api-boilerplate

Assistant: 请选择框架:

  • Express (Node.js)

  • FastAPI (Python)

  • Next.js API Routes

  • Flask (Python)

用户: 1

Assistant: 请提供以下信息:

  • 项目名称: my-api

  • 端口: 3000

  • 需要的中间件 (cors, body-parser, helmet): cors, helmet

  • 是否需要数据库连接: no

  • 是否需要认证: no

正在生成 Express API...

✅ API 样板代码已生成!

项目位置: ./my-api

快速开始:

cd my-api npm install npm start

API 将在 http://localhost:3000 运行

详细模板请查看 templates/ 目录。

请选择要使用的框架(输入数字 1-4)。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

test-generator

No summary provided by upstream source.

Repository SourceNeeds Review
General

batch-renamer

No summary provided by upstream source.

Repository SourceNeeds Review
General

markdown-organizer

No summary provided by upstream source.

Repository SourceNeeds Review