add 直接替换index.html,不使用新的类库。

This commit is contained in:
luoyunchong
2020-08-09 21:23:27 +08:00
parent c80e602c35
commit 2f68ad5080
33 changed files with 1047 additions and 10 deletions

View File

@@ -1,5 +1,9 @@
# IGeekFan.AspNetCore.Knife4jUI
一个支持.NET Core3.0,.NET Standard2.0的swagger ui 库:**knife4j UI**。
一个swagger ui 库:**[knife4j UI](https://gitee.com/xiaoym/knife4j)**,支持 .NET Core3.0+或.NET Standard2.0。
[![nuget](https://img.shields.io/nuget/v/IGeekFan.AspNetCore.Knife4jUI.svg?style=flat-square)](https://www.nuget.org/packages/IGeekFan.AspNetCore.Knife4jUI) [![stats](https://img.shields.io/nuget/dt/IGeekFan.AspNetCore.Knife4jUI.svg?style=flat-square)](https://www.nuget.org/stats/packages/IGeekFan.AspNetCore.Knife4jUI?groupby=Version) [![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://raw.githubusercontent.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI/master/LICENSE.txt)
## 相关依赖项
### [knife4j](https://gitee.com/xiaoym/knife4j)
@@ -12,9 +16,9 @@
- [Basic](https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI/blob/master/test/Basic)
- [Knife4jUIDemo](https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI/blob/master/test/Knife4jUIDemo)
## 快速开始
## 📚 快速开始
### 安装包
### 🚀安装包
1.Install the standard Nuget package into your ASP.NET Core application.
@@ -31,10 +35,9 @@ using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using IGeekFan.AspNetCore.Knife4jUI;
```
### ConfigureServices
### 🚁 ConfigureServices
CustomOperationIds
AddServer,必须的。
3.服务配置,CustomOperationIds和AddServer是必须的。
```
services.AddSwaggerGen(c =>
{
@@ -51,8 +54,8 @@ AddServer,必须的。
});
```
### Configure
### 💪 Configure
4. 中间件配置
```
app.UseSwagger();
@@ -70,7 +73,7 @@ app.UseEndpoints(endpoints =>
```
### 效果图
### 🔎 效果图
运行项目,打开 https://localhost:5001/index.html#/home
![https://pic.downk.cc/item/5f2fa77b14195aa594ccbedc.jpg](https://pic.downk.cc/item/5f2fa77b14195aa594ccbedc.jpg)
@@ -83,4 +86,6 @@ app.UseEndpoints(endpoints =>
### 更多项目
- [https://api.igeekfan.cn/swagger/index.html](https://api.igeekfan.cn/swagger/index.html)
- [https://api.igeekfan.cn/swagger/index.html](https://api.igeekfan.cn/swagger/index.html)
- [https://github.com/luoyunchong/lin-cms-dotnetcore](https://github.com/luoyunchong/lin-cms-dotnetcore)
![image](https://pic.downk.cc/item/5f2fa97814195aa594cd5cfc.jpg)