如何将 micronaut 的默认端口(8080)更改为其他端口?
How to change default port(8080) of micronaut to something else?
如何将 Micronaut 中的默认端口 8080
更改为其他端口?我的项目使用Micronaut,找不到更改端口号的配置。
您可以在 src/main/resources/application.yml
文件中指定自定义服务器端口,例如:
micronaut:
server:
port: 8081
或者,您可以设置一个环境变量MICRONAUT_SERVER_PORT
。
For more information, check the official documentation page https://docs.micronaut.io/latest/guide/index.html#runningSpecificPort
如何将 Micronaut 中的默认端口 8080
更改为其他端口?我的项目使用Micronaut,找不到更改端口号的配置。
您可以在 src/main/resources/application.yml
文件中指定自定义服务器端口,例如:
micronaut:
server:
port: 8081
或者,您可以设置一个环境变量MICRONAUT_SERVER_PORT
。
For more information, check the official documentation page https://docs.micronaut.io/latest/guide/index.html#runningSpecificPort