0.0.1 • Published 7 years ago

swagger-ui-for-superlight v0.0.1

Weekly downloads
5
License
-
Repository
-
Last release
7 years ago

Swagger UI

This is the copy of the original code of swagger-ui, 3.x.

This repo is based on swagger-ui-dist that comes pre-bundled with all dependencies and can be incorporated directly in a webapp.

How to run

Locally

No need to run npm install. It's pre-packaged website already. You can use local web server

  • run $ npm install -g local-web-server
  • run ws in the root folder of the project
  • if you need to use another port - run ws --port 5000
On AWS
  • run $ npm install Using VS Code

SwaggerUIBundle

This project uses swagger-ui's bundle (see source of swagger-ui html page. SwaggerUi object is instatiated as below - please modify URLs of the services you want to include:

const ui = SwaggerUIBundle({
    requestInterceptor: (req) => {
      req.headers["version"]='1';
      console.log(req.headers);
      return req
    },
    urls: [
      {url:"https://pny3oeexcd.execute-api.us-west-2.amazonaws.com/dev/users/api-docs",name:"Users"},
      {url:"https://u83yxe7q7d.execute-api.us-west-2.amazonaws.com/dev/devices/api-docs", name:"Devices"},
      {url:"https://6zw0aw28a6.execute-api.us-west-2.amazonaws.com/dev/groups/api-docs",name:"Groups"},
      {url:"https://2i27s3jsr8.execute-api.us-west-2.amazonaws.com/dev/assets/api-docs",name:"Assets"},
      {url:"https://z1epin2q20.execute-api.us-west-2.amazonaws.com/dev/analytics/api-docs",name:"Analytics"}
    ],
    dom_id: '#swagger-ui',
    deepLinking: true,
    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIStandalonePreset
    ],
    plugins: [
      SwaggerUIBundle.plugins.DownloadUrl
    ],
    layout: "StandaloneLayout"
  })