added page async api

pull/1/head
Vyacheslav N. Boyko 2022-04-08 10:48:07 +03:00
parent f4ca6f893f
commit 3d2cc869e9
8 changed files with 75 additions and 13 deletions

3
.gitignore vendored
View File

@ -1,5 +1,8 @@
.idea
/.idea/.gitignore
/.idea/misc.xml
/.idea/modules.xml
/.idea/pf-waas-api.iml
/.idea/vcs.xml
**.**~
**.iml

View File

@ -1 +1,16 @@
# pf-waas-api
## Обновление Async API
### Предварительно установить библиотеку
``` bash
npm install -g @asyncapi/html-template@0.16.0
```
### Запустить пересборку HTML
``` bash
cd async-api/site/
ag ../waas-async-api.yaml @asyncapi/html-template
```

View File

@ -0,0 +1,23 @@
asyncapi: 2.3.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
card/authorization:
subscribe:
message:
$ref: '#/components/messages/UserSignedUp'
components:
messages:
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user

View File

@ -1,11 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>ReDoc</title>
<title>ProFee WAAS API</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
<!--
ReDoc doesn't change outer page styles
@ -18,22 +19,38 @@
</style>
</head>
<body>
<redoc spec-url=''></redoc>
<div class="tabs is-large">
<ul>
<li id="page-api" class="is-active"><a>API</a></li>
<li id="page-async-api"><a>Async API</a></li>
</ul>
</div>
<div id="api">
<redoc spec-url=''></redoc>
</div>
<div id="async-api">
</div>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script>
if (document.readyState == 'loading') {
document.addEventListener("DOMContentLoaded", () => initRedoc());
} else {
initRedoc();
}
if (document.readyState == 'loading') {
document.addEventListener("DOMContentLoaded", () => initRedoc());
} else {
initRedoc();
}
var isLocalhost = location.hostname === "localhost" || location.hostname === "127.0.0.1";
var api_url = isLocalhost ? '/waas-api.json' : 'https://profee-waas.github.io/pf-waas-api/waas-api.json';
var isLocalhost = location.hostname === "localhost" || location.hostname === "127.0.0.1";
var api_url = isLocalhost ? '/api/waas-api.json' : 'https://profee-waas.github.io/pf-waas-api/api/waas-api.json';
function initRedoc() {
Redoc.init(api_url, {"pathInMiddlePanel":true});
}
function initRedoc() {
Redoc.init(api_url, {"pathInMiddlePanel":true});
}
</script>
</body>

1
update-api.sh 100755
View File

@ -0,0 +1 @@
curl http://localhost:8081/api-docs > api/waas-api.json

View File

@ -0,0 +1,4 @@
#!/bin/bash
cd async-api/site/
ag ../waas-async-api.yaml @asyncapi/html-template

View File

@ -1 +0,0 @@
curl http://localhost:8081/api-docs > waas-api.json