Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rookie-luochao committed Jun 5, 2024
1 parent e50b69b commit 1615593
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

## 使用方法
### CDN接入
`spec-url``完整路径`

```tsx
<!doctype html>
<html lang="en">
Expand All @@ -61,6 +63,23 @@
</body>
</html>
```

`spec-url``路径`

```tsx
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>openAPI UI</title>
</head>
<body>
<div id="openapi-ui-container" spec-url="/openapi.json" theme="dark"></div>
<script src="https://cdn.jsdelivr.net/npm/openapi-ui-dist@latest/lib/openapi-ui.umd.js"></script>
</body>
</html>
```

### React接入(或者 Vue接入)
```tsx
import { useEffect } from "react";
Expand All @@ -84,6 +103,9 @@ export const openapiRoutes = {
### Golang后端框架接入
- [go-openapi-ui](https://github.com/rookie-luochao/go-openapi-ui)

### Nodejs后端框架接入
- [nodejs-openapi-ui](https://github.com/openapi-ui/nodejs-openapi-ui)

## 快速开始
```bash
# node version >= 18
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ OpenAPI/Swagger UI document, quickly generate mock params and call api, also sim

## Usage
### With CDN
`spec-url` is `full path`

```tsx
<!doctype html>
<html lang="en">
Expand All @@ -61,6 +63,23 @@ OpenAPI/Swagger UI document, quickly generate mock params and call api, also sim
</body>
</html>
```

`spec-url` is `path`

```tsx
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>openAPI UI</title>
</head>
<body>
<div id="openapi-ui-container" spec-url="/openapi.json" theme="dark"></div>
<script src="https://cdn.jsdelivr.net/npm/openapi-ui-dist@latest/lib/openapi-ui.umd.js"></script>
</body>
</html>
```

### With React(or With Vue)
```tsx
import { useEffect } from "react";
Expand All @@ -84,6 +103,9 @@ export const openapiRoutes = {
### With Go Web Framework
- [go-openapi-ui](https://github.com/rookie-luochao/go-openapi-ui)

### With Nodejs Web Framework
- [nodejs-openapi-ui](https://github.com/openapi-ui/nodejs-openapi-ui)

## Quick start
```bash
# node version >= 18
Expand Down

0 comments on commit 1615593

Please sign in to comment.