Skip to content

handsomeFive/apiGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-generator 工具

Highlights

  • 配置化
  • 支持导出泛型
  • 暂支持 swagger.json

Install

npm install api-generate-tool -D

Usage

Firstly, create api-generator.json in the root directory

{
  "output": "./",
  "requestPath": "@/api",
  "prefix": "/api"
}

I use this in my npm scripts:

{
  "scripts": {
    "generate-api": "generate-api"
  }
}

then run

npm run generate-api

Config

name required description
output false generated file path
requestPath true (when requestDefaultPath not exits) request object path
requestDefaultPath true (when requestPath not exits) request object path (the default export mode is used)
prefix false prefix path

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published