简体   繁体   中英

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} ?

In Config.groovy, , setting grails.serverUrl has absolutely no effect - it only seems to affect absolute url generation of different grails methods.

In production, I use apache virtualhosts to mask site.com:8080/appName as site.com . I want to make my test configuration match production.

How about

grails.app.context = "/"

in Config.groovy , as per this jira discussion?

If you are running Grails 3.1.1 you can add the following line to your
grails-app/conf/application.yml file to bring back the http://localhost:8080/appName functionality:

server:
    'contextPath': '/appName'

Replace appName with your application's actual name (ie the folder name that the grails-app folder is in).

With recent versions of Grails this can also be set in application.properties :

app.context=/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM