Change default port for swagger-ui dist package

How would you like to change the default port of the swagger-ui dist version ?

By default, it listens for port requests 8080. I want him to listen to some other port. The use case is that we want several runs to be launched on our hosting, but listen to different ports.

Is this possible, or do you really need to do more complex setup?

We run it through the node js package by default:

{
  "name": "dist",
  "version": "1.0.0",
  "description": "",
  "main": "swagger-ui-bundle.js",
  "scripts": {
    "start": "http-server"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
+4
source share
2 answers

From here and here , you can as follows:

You should be able to use redefine port in basePath

0

, , -p 80:8080:

https://hub.docker.com/r/swaggerapi/swagger-ui/

docker run -p 80:8080 -e API_URL=http://generator.swagger.io/api/swagger.json swaggerapi/swagger-ui

API_URL - SWAGGER_JSON "/app/swagger.json" swagger.json ( docker --volume)

0

Source: https://habr.com/ru/post/1691913/


All Articles