Skip to content

Commit 6bb0a4e

Browse files
committed
docs(readme): 添加初始化命令及配置文件说明
1 parent b6925ca commit 6bb0a4e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,30 @@ OpenAPI → Axios
2020

2121
```shell
2222
npm i -D openapi-axios
23+
npm i axios
2324
```
2425

2526
# 使用
2627

2728
## 创建配置文件
28-
29-
在项目根目录下创建配置文件 openapi.config.js(也可以是 openapi.config.cjs)。
30-
29+
```shell
30+
npx openapi-axios init
31+
```
32+
将在项目根目录下创建配置文件 openapi.config.cjs:
3133
```js
32-
// openapi.config.js
34+
/**
35+
* openapi-axios config
36+
* @link https://github.com/FrontEndDev-org/openapi-axios
37+
*/
38+
3339
const { defineConfig } = require('openapi-axios');
3440

3541
module.exports = defineConfig({
3642
modules: {
37-
// 将会生成 src/apis/petStore3.ts 文件
3843
'petStore3': 'https://petstore31.swagger.io/api/v31/openapi.json'
3944
},
4045
});
46+
4147
```
4248

4349
## 生成 API 文件

0 commit comments

Comments
 (0)