How to remove app name and port from url in grails?
Asked Answered
C

3

19

Instead of deploying my app to

http://localhost:8080/myApp

I want to deploy it to

http://localhost
Cornelius answered 13/5, 2011 at 9:30 Comment(0)
M
29

To change the run-app port, edit grails-app/conf/BuildConfig.groovy and add the line

grails.server.port.http = 80

To remove the context (the 'myApp' part) edit application.properties and add the line

app.context=/
Melessa answered 13/5, 2011 at 12:27 Comment(1)
or to remove the 'myApp' part, add the following code block to Config.groovy: grails.app.context="/". Not sure but application.properties is auto generated file, so it is safe to add in Config.groovyNoaccount
D
5

deploy your app to a tomcat server with the war name as ROOT.war. Because war names describe contexts... papa.war will be available through [root_domain]/papa

Dorotheadorothee answered 13/5, 2011 at 9:38 Comment(4)
i got one more solution by googling i.e if i write grails.app.context="/" in conf.groovy file ill get url with out app name.but i when i run with -Dserver.port=80 run-app it won work as before and app name will display.Cornelius
i am still in development mode not deployed yet..and i am using 80 apache port bcz i don want to display any port number in URLCornelius
SO in development how can i achieve it with default port?Cornelius
but what if I have more than one Application running. I could not run them all using ROOT.war!?Watermark
A
4

To remove the port, use:

grails -Dserver.port=80 run-app
Amusement answered 13/5, 2011 at 11:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.