如何配置 Quarkus 应用程序运行的端口? [英] How can I configure the port a Quarkus application runs on?

查看:39
本文介绍了如何配置 Quarkus 应用程序运行的端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的 Quarkus 应用程序在非默认端口上运行.我怎样才能做到这一点?

I would like my Quarkus application to run on a port other than the default. How can I accomplish that?

推荐答案

要使用的 Quarkus 配置属性是 quarkus.http.port(默认值为 8080).如果在 application.properties 中设置了此属性,则将使用该值.

The Quarkus configuration property to be used is quarkus.http.port (the default value is 8080). If this property is set in application.properties then that value will be used.

该属性也可以在运行时被覆盖,如下所示:

The property can also be overridden at runtime as follows:

在 JVM 模式下运行 Quarkus 应用程序时,您可以使用 quarkus.http.port 系统属性设置端口.例如:

When running a Quarkus application in JVM mode you can set the port using the quarkus.http.port System property. For example:

java -Dquarkus.http.port=8081 -jar example-runner.java

相同的属性适用于 GraalVM 原生模式镜像.例如:

The same property applies to GraalVM Native Mode images. For example:

./example-runner -Dquarkus.http.port=8081

这篇关于如何配置 Quarkus 应用程序运行的端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆