How do I set my grails 3 app to use context root?
I am trying to set the root context path for my application in `conf / application.yml 'like this:
server:
'context-path': '/'
However, when I try to run, grails> run-app
I get the following exception:
FAILURE: Build failed with exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
+3
Chris snow
source
to share
2 answers
I should have paid more attention to the error log output from run-app
. Correct setting:
server:
'context-path': ''
> = Grails 3.0.3:
server:
contextPath: ''
+2
Chris snow
source
to share
From Grails 3.0.3 the expected config keycontextPath
is camel case and is not hyphenated. So the correct setting in your application.yml
:
server:
contextPath: '/my-path'
Or if you are using application.groovy
:
server.contextPath='/my-path'
+6
lifeisfoo
source
to share