grails run-app on localhost:8080 instead of :8080/appName?
Asked Answered
N

3

11

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.

Nicolina answered 15/2, 2011 at 4:22 Comment(0)
S
19

How about

grails.app.context = "/"

in Config.groovy, as per this jira discussion?

Stratus answered 15/2, 2011 at 4:29 Comment(0)
P
2

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 (i.e. the folder name that the grails-app folder is in).

Pion answered 14/2, 2016 at 1:34 Comment(0)
N
0

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

app.context=/

Neuropathy answered 8/12, 2013 at 17:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.