Thursday, January 18, 2018

Change default port for swagger-ui dist bundle

Leave a Comment

How would you go about changing the default port of swagger-ui dist version?

By default it listens to requests on port 8080. I want it to listen to some other port. The use case is that we want to have a couple of dists running on our host but listening on different ports.

Is this possible or do you actually need to do some more complicated setup?

We run it via node js default package:

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

2 Answers

Answers 1

From here and here, you may read:

You should be able to use override the port in the basePath

Answers 2

The simples solution that I know Is just to use docker and map port by -p 80:8080:

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

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment