Skip to content
Snippets Groups Projects
user avatar
Ryan Sanford authored
2fe733c1
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..
README.md
index.html

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's recommended cli build tool:

    $ 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
      • Intermediate build artifacts can be removed: $ rm -rf docs/bower_components docs/src
      • This readme gets wiped - use git checkout docs/README.md
  4. Enable branch selection via search & replace in docs/index.html:

    document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/master/raml/api.raml")
    var url=new URL(location.href);var branch=new URLSearchParams(url.search).get("branch")||"master";document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/"+branch+"/raml/api.raml")
  5. Test it out:

    1. $ cd docs && python2 -m SimpleHTTPServer
    2. Visit http://localhost:8000