[英]grails run-app on localhost:8080 instead of :8080/appName?
Is there a way to get grails run-app to launch on localhost:8080/
instead of localhost:8080/${appName}
? 有没有办法让grails run-app在
localhost:8080/
而不是localhost:8080/${appName}
?
In Config.groovy,
, setting grails.serverUrl
has absolutely no effect - it only seems to affect absolute url generation of different grails methods. 在
Config.groovy,
,设置grails.serverUrl
绝对无效-似乎只影响不同grails方法的绝对URL生成。
In production, I use apache virtualhosts to mask site.com:8080/appName
as site.com
. 在生产中,我使用apache虚拟主机将
site.com:8080/appName
屏蔽为site.com
。 I want to make my test configuration match production. 我想使我的测试配置与生产匹配。
If you are running Grails 3.1.1 you can add the following line to your 如果您正在运行Grails 3.1.1,则可以将以下行添加到您的
grails-app/conf/application.yml
file to bring back the http://localhost:8080/appName
functionality: grails-app/conf/application.yml
文件http://localhost:8080/appName
功能:
server:
'contextPath': '/appName'
Replace appName
with your application's actual name (ie the folder name that the grails-app
folder is in). 将
appName
替换为应用程序的实际名称(即grails-app
文件夹所在的文件夹名称)。
With recent versions of Grails this can also be set in application.properties : 在最新版本的Grails中,也可以在application.properties中进行设置:
app.context=/ app.context = /
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.