2017-05-05 39 views
0

我想设置每个环境的serverURL在application.yml如下:的Grails 3的serverURL在application.yml

environments: 
    development: 
     grails: 
      serverURL: http://localhost:8089 
     dataSource: 
      dbCreate: create 
      url: jdbc:postgresql://localhost:5432/tests 
      username: postgress 
      password: rootass 

但它不工作 - 当我做run-app它仍然在8080上。此外,我怎么设置应用程序的名称或上下文的名字,所以当我做run-app这就像http://localhost:8089/vis

回答

0

尝试以下操作:

server: 
    port: 8089 

您可以添加contextPat如果需要,例如与港口相同的水平。

server: 
    port: 8089 
    contextPath: '/myApp' 

如果我部署到example.com,我怎么指定为example.com/myApp应该是在http://localhost:8089/myApp

+0

访问? – user903772

+0

我个人在httpd.conf中使用apache&ServerName,因此在你的情况下将是'example.com',然后在上面设置你的应用程序的contextPath时可以访问example.com/myApp –

+0

不能在控制器中使用 – user903772