-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## [0.1.0] - 2020-01-05 | ||
|
||
### Added | ||
- First release of the project | ||
- CHANGELOG.md file | ||
- README.md file | ||
|
||
[0.1.0]: https://github.com/jjzcru/swagger-ui-loader/releases/tag/v0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## Installation | ||
|
||
### Npm | ||
```console | ||
npm install swagger-ui-loader --save-dev | ||
``` | ||
|
||
### Yarn | ||
```console | ||
yarn add swagger-ui-loader --dev | ||
``` | ||
|
||
## Usage | ||
Add a run script that executes `swagger-ui-loader`. Your `package.json` should look similar to this. Now just run `npm run swagger`. | ||
|
||
```json | ||
{ | ||
"name": "i-am-your-package🤖", | ||
"scripts": { | ||
"swagger": "swagger-ui-loader" | ||
}, | ||
"devDependencies": { | ||
"swagger-ui-loader": "^0.1.0" | ||
} | ||
} | ||
``` | ||
|
||
Be default it will search for `swagger.json`, `swagger.yml` or `swagger.yaml` on the root directory of the project and it will run a server on port `5466`. | ||
|
||
You can add a property `swagger` to `package.json` with the following properties: | ||
|
||
- `file`: The path on which the file with the swagger data is located. | ||
- `port`: The port on which you want the server to run. | ||
|
||
The `package.json` will look like this with those properties. | ||
```json | ||
{ | ||
"name": "i-am-your-package🤖", | ||
"scripts": { | ||
"swagger": "swagger-ui-loader" | ||
}, | ||
"swagger": { | ||
"file": "./docs/swagger.yml", | ||
"port": 8888, | ||
}, | ||
"devDependencies": { | ||
"swagger-ui-loader": "^0.1.0" | ||
} | ||
} | ||
``` | ||
|
||
If you run `npm run swagger` it will search for the `swagger.yml` inside the `docs` directory and the server will run on port `8888`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters