springfox swagger 生成不正确的基本 URL

时间:2021-04-12 12:13:17

标签: java swagger swagger-ui springfox

Springfox swagger UI 具有错误的基本 URL。我不清楚 19080 端口来自哪里,因为没有服务在该端口上侦听。我需要做哪些设置才能让 springfox 生成正确的基本 URL?

Swagger 界面

错误的基本网址

  • 基本网址:dev.example.com:19080/newapi

正确的基本网址

  • 基本网址:dev.example.com/newapi

以下是我使用的 Springfox 版本。

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.9.2</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.9.2</version>
        <scope>compile</scope>
    </dependency>

1 个答案:

答案 0 :(得分:0)

如果你想改变端口号,你将添加属性文件端口号。例如,

server.port=8081
相关问题