Grails 3.0 static html in run-app
Add the index.html
to src/main/resources/public
Then add this to UrlMappings.groovy
:
"/"(redirect:"/index.html")
For grails >= 3.0.12
Location of static resources
In order to resolve an issue around how POST requests are treated for REST applications on non-existent resources, static resources located in src/main/resources/public are now resolved under the /static/** URI by default, instead of the base URI /**. If you wish to restore the previous behaviour add the following configuration:
grails.resources.pattern = '/**'
Contrary to the accepted answer, you don't need a redirect. I have made able to make this work with the following config:
UrlMappings.groovy"/"(uri: "/index.html")
application.ymlgrails: resources: pattern: '/**'
Finally, you just need to have your index.html
file located under src/main/webapp