Grails 3.0 static html in run-app Grails 3.0 static html in run-app angularjs angularjs

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 = '/**'

https://github.com/grails/grails-core/releases/tag/v3.0.12


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