简体   繁体   中英

Grails 3 serverURL in application.yml

I'm trying to set the serverURL per environment in application.yml as follows:

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

But it doesn't work - when I do run-app it still runs on 8080. Also, how do I set the app name or context name so when I do run-app it's like http://localhost:8089/vis

Try the following:

server:
    port: 8089

You can add contextPath at the same level as port if need be eg

server:
    port: 8089
    contextPath: '/myApp'

Should be accessible at http://localhost:8089/myApp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM