How to deploy Grails app without context path?

笑着哭i 提交于 2020-01-05 10:26:11

问题


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:


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


来源:https://stackoverflow.com/questions/23812063/how-to-deploy-grails-app-without-context-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!