升级到:Grails 3.3.2,设置服务器 URL

Upgrade to: Grails 3.3.2, setting server URL

您好,我正在将现有的 Grails 2.4.5 升级到 Grails 3.3.2。我关注了https://docs.grails.org/3.0.x/guide/upgrading.html. Grails app runs at localhost:8080, but I want server URL as http://localhost:8080/projectName。我尝试将以下内容添加到 application.yml:

environments:
   development:
     grails:
       serverURL: http://localhost:8080/projectName

而 URLMappings.groovy 如下所示:

"/"(view:"/index")
"500"(view:'/error')
"404"(view:'/notFound')

我做错了什么?

添加server.contextPath:

environments:
  development:
    server:
      contextPath: /projectName