简体   繁体   English

是否在localhost:8080而不是:8080 / appName上运行应用程序?

[英]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. 我想使我的测试配置与生产匹配。

How about 怎么样

grails.app.context = "/"

in Config.groovy , as per this jira discussion? Config.groovy ,按照这个 jira的讨论?

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.

相关问题 Grails - 在run-app上使用localhost的子域名 - Grails - using subdomain of localhost on run-app 以编程方式运行grails run-app - Run grails run-app programmatically 当我运行 java servlet 来查看 JSON 结果时——它弹出文件下载而不是 http://localhost:8080/ - When I run java servlet to view JSON result — it pops up file download instead of http://localhost:8080/ Apache Tomcat或Eclipse重定向到localhost:8080 /而不是localhost:8080 / projectname / index.jsp - Apache Tomcat or Eclipse redirect to localhost:8080/ instead of localhost:8080/projectname/index.jsp grails 2.5.2运行应用程序有效,但不能运行 - grails 2.5.2 run-app works but not run-war 在运行应用程序环境中运行grails集成测试 - Run grails integration tests in run-app environment Tomcat服务器上的Intellij Web应用程序显示http:// localhost:8080 / index.jsp而不是http:// localhost:8080 / myapp / index.jsp - Intellij web application on tomcat server shows http://localhost:8080/index.jsp instead of http://localhost:8080/myapp/index.jsp 如何将流量从localhost:8080路由到localhost:8080 / myapp - How to route traffic from localhost:8080 to localhost:8080/myapp Tomcat已启动,但本地主机8080不可用 - Tomcat started but localhost 8080 is not availble Grails运行应用程序从根上下文提供文件 - grails run-app serve files from root context
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM