Search code examples
grailsweb-applicationscontextpath

How to deploy Grails app without context path?


Not sure if I'm using the term "context path" correctly here, but currently when I run my Grails (2.3.6) app locally, it comes up at http://localhost:8080/myapp. Ultimately, I'd like it to be deployed to an actual app server at http://myapp.com.

Is this possible? If not, why? If so, how?


Solution

  • In config.groovy, just set:

    grails.app.context = "/"
    

    Also, you should probably update your environments in config.groovy as well:

    environments {
        development {
            grails.serverURL = "http://localhost:8080"
        }
        production {
            grails.serverURL = "http://myapp.com"
        }
    }