How to deploy Grails app without context path?

2019-07-26 19:43发布

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?

1条回答
闹够了就滚
2楼-- · 2019-07-26 20:12

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"
    }
}
查看更多
登录 后发表回答