-
Notifications
You must be signed in to change notification settings - Fork 18
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
1 parent
6c95637
commit 2d274f0
Showing
1 changed file
with
32 additions
and
0 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,32 @@ | ||
### Updating api-console | ||
|
||
1. Run a node container with the core root-dir bind-mounted: | ||
|
||
`$ docker run -itv $(pwd):/core -w /core node bash` | ||
|
||
|
||
2. Install [api-console](https://github.com/mulesoft/api-console)'s recommended [cli build tool](https://github.com/mulesoft/api-console/blob/master/docs/build-tools.md): | ||
|
||
`$ npm install -g api-console-cli` | ||
|
||
|
||
3. Generate "standalone" console into `./docs`: | ||
|
||
`$ api-console build https://raw.githubusercontent.com/scitran/core/master/raml/api.raml --output ./docs` | ||
|
||
Notes: | ||
* This can take a couple minutes | ||
* The `./docs` folder is recreated in the container | ||
- Owned by root - use `sudo chown -R $USER:$USER docs` on the host | ||
- This readme gets wiped - use `git checkout docs/README.md` | ||
|
||
|
||
4. Enable branch selection via search & replace in `docs/index.html`: | ||
|
||
```javascript | ||
document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/master/raml/api.raml") | ||
``` | ||
|
||
```javascript | ||
var url=new URL(location.href);var branch=url.searchParams.get("branch")||"master";document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/"+branch+"/raml/api.raml") | ||
``` |