Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
docs: Add API documents
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalanamini committed Mar 8, 2022
1 parent cb4f46d commit 5cb841f
Show file tree
Hide file tree
Showing 17 changed files with 8,948 additions and 1,970 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ dist
.build/

# Documents
docs/api/swagger.yaml
docs/code/

# IDE
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ XCoins code review repository.
- [Docker](#docker)
- [Documents](#documents)
- [Code](#code-documents)
- [API](#api-documents)
- [Directory Layout](#directory-layout)
- [Versioning](#versioning)
- [Code Review](#code-review)
Expand Down Expand Up @@ -137,6 +138,20 @@ npm run docs:code

After running this command, open `docs/code/index.html` in your preferred browser.

#### API Documents

Generate the API documents to be served statically. (Using _Swagger_[^SWAGGER_FOOTNOTE])

```shell
npm run docs:swagger
```

Generate & serve the API documents. (The documents' server address will be printed in the terminal)

```shell
npm run docs:api
```

## Directory Layout

```
Expand Down Expand Up @@ -279,4 +294,6 @@ This section includes the issues, changes & improvements I've made, with the tho

[^TYPEDOC_FOOTNOTE]: [TypeDoc](https://typedoc.org)

[^SWAGGER_FOOTNOTE]: [Swagger](https://swagger.io)

[^SEMVER_FOOTNOTE]: [SemVer](http://semver.org)
31 changes: 31 additions & 0 deletions docs/api/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>

<html lang="en">

<head>
<title>API Documents</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">

<!--
ReDoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>

<body>

<redoc spec-url="/swagger.yaml"></redoc>

<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"></script>

</body>

</html>
1 change: 1 addition & 0 deletions docs/api/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disallow: /
Loading

0 comments on commit 5cb841f

Please sign in to comment.