swagger-ui-lite
this zero-dependency package will provide a rollup, single-script version of the swagger-ui client (v2.1.5), with a working web-demo
live web demo
git-branch : | master | beta | alpha |
---|---|---|---|
test-server-github : | ![]() |
![]() |
![]() |
test-server-heroku : | ![]() |
![]() |
![]() |
test-report : | |||
coverage : | |||
build-artifacts : | ![]() |
![]() |
![]() |
table of contents
- cdn download
- documentation
- quickstart standalone app
- quickstart example.js
- extra screenshots
- package.json
- changelog of last 50 commits
- internal build script
- misc
cdn download
- https://kaizhu256.github.io/node-swagger-ui-lite/build..beta..travis-ci.org/app/assets.swagger_ui.html
- https://kaizhu256.github.io/node-swagger-ui-lite/build..beta..travis-ci.org/app/assets.swagger_ui.petstore.json
- https://kaizhu256.github.io/node-swagger-ui-lite/build..beta..travis-ci.org/app/assets.swagger_ui.rollup.js
documentation
cli help
api doc
todo
- none
changelog 2018.12.8
- npm publish 2018.12.8
- do not require following nodejs builtins by default: console, constants, module, process, punycode
- update build
- none
this package requires
- darwin or linux os
additional info
- swagger-ui code derived from https://github.com/swagger-api/swagger-ui/tree/v2.1.5/dist/lib
quickstart standalone app
to run this example, follow the instruction in the script below
# example.sh # this shell script will download and run a web-demo of swagger-ui-lite as a standalone app # 1. download standalone app curl -O https://kaizhu256.github.io/node-swagger-ui-lite/build..beta..travis-ci.org/app/assets.app.js# 2. run standalone app PORT=8081 node ./assets.app.js# 3. open a browser to http://127.0.0.1:8081 and play with the web-demo # 4. edit file assets.app.js to suit your needs
output from browser
output from shell
quickstart example.js
to run this example, follow the instruction in the script below
/*example.js this script will run a web-demo of swagger-ui-lite instruction 1. save this script as example.js 2. run the shell-command: $ npm install swagger-ui-lite && PORT=8081 node example.js 3. open a browser to http://127.0.0.1:8081 and play with the web-demo 4. edit this script to suit your needs*/ /* istanbul instrument in package swagger_ui *//* istanbul ignore next *//* jslint utility2:true */ { "use strict"; var consoleError; var local; // init globalThis { try globalThis = Function"return this"; // jslint ignore:line catch ignore {} }; globalThisglobalThis = globalThis; // init debug_inline if !globalThis"debug\u0049nline" consoleError = consoleerror; globalThis"debug\u0049nline" = { /* * this function will both print <arguments> to stderr * and return <arguments>[0] */ var argList; argList = Array; // jslint ignore:line // debug arguments globalThis"debug\u0049nlineArguments" = argList; ; consoleError; ; // return arg0 for inspection return argList0; }; // init local local = {}; locallocal = local; globalThisglobalLocal = local; // init isBrowser localisBrowser = typeof window === "object" && window === globalThis && typeof windowXMLHttpRequest === "function" && windowdocument && typeof windowdocumentquerySelectorAll === "function" ; // init function local { /* * this function will throw the error <message> if <passed> is falsy */ var error; if passed return; error = // ternary-condition message && typeof messagemessage === "string" && typeof messagestack === "string" // if message is an error-object, then leave it as is ? message : typeof message === "string" // if message is a string, then leave it as is ? message // else JSON.stringify message : JSON ; throw error; }; local { /* * this function will if <fnc> exists, * them return <fnc>, * else return <nop> */ return fnc || localnop; }; local { /* * this function will return <value> */ return value; }; local { /* * this function will do nothing */ return; }; // require builtin if !localisBrowser localassert = ; localbuffer = ; localchild_process = ; localcluster = ; localcrypto = ; localdgram = ; localdns = ; localdomain = ; localevents = ; localfs = ; localhttp = ; localhttps = ; localnet = ; localos = ; localpath = ; localquerystring = ; localreadline = ; localrepl = ; localstream = ; localstring_decoder = ; localtimers = ; localtls = ; localtty = ; localurl = ; localutil = ; localvm = ; localzlib = ; }this; {"use strict"; // run shared js-env code - init-before {// init locallocal = globalThisutility2_rollup || globalThisutility2_swagger_ui || ;// init exportsglobalThislocal = local;}; /* istanbul ignore next */// run browser js-env code - init-test {if !localisBrowser return;}; /* istanbul ignore next */// run node js-env code - init-test {if localisBrowser return;// init exportsmoduleexports = local;/* validateLineSortedReset */// init assetslocalassetsDict = localassetsDict || {}; "assets.index.template.html" "assets.swgg.swagger.json" "assets.swgg.swagger.server.json";/* validateLineSortedReset *//* jslint ignore:start */localassetsDict"/assets.swagger_ui.js" = localassetsDict"/assets.swagger_ui.js" || localfs;/* jslint ignore:end *//* validateLineSortedReset */localassetsDict"/" = localassetsDict"/assets.index.template.html";localassetsDict"/assets.example.html" = localassetsDict"/";localassetsDict"/index.html" = localassetsDict"/";// init cliif module !== requiremain || globalThisutility2_rollup return;/* validateLineSortedReset */localassetsDict"/assets.example.js" = localassetsDict"/assets.example.js" || localfs;localassetsDict"/favicon.ico" = localassetsDict"/favicon.ico" || "";// if $npm_config_timeout_exit exists,// then exit this process after $npm_config_timeout_exit msif Numberprocessenvnpm_config_timeout_exit ;// start serverif globalThisutility2_serverHttp1 return;processenvPORT = processenvPORT || "8081";console;localhttp;}; };
output from browser
output from shell
extra screenshots
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.buildCi.browser.%252Ftmp%252Fbuild%252Fapidoc.html.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.buildCi.browser.%252Ftmp%252Fbuild%252Fcoverage.lib.html.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.buildCi.browser.%252Ftmp%252Fbuild%252Ftest-report.html.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployGithub.browser.%252Fnode-swagger-ui-lite%252Fbuild%252Fapp%252Fassets.swgg.html.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployGithub.browser.%252Fnode-swagger-ui-lite%252Fbuild%252Fapp.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployGithubTest.browser.%252Fnode-swagger-ui-lite%252Fbuild%252Fapp.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployHeroku.browser.%252Fassets.swgg.html.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployHeroku.browser.%252F.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.deployHerokuTest.browser.%252F.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.npmTest.browser.%252F.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.testExampleJs.browser.%252F.png
-
https://kaizhu256.github.io/node-swagger-ui-lite/build/screenshot.testExampleSh.browser.%252F.png
package.json
changelog of last 50 commits
internal build script
- build_ci.sh
# build_ci.sh # this shell script will run the build for this package # run shBuildCi eval "$(utility2 source)"shBuildCi
misc
- this package was created with utility2