Reputation: 165
I'm attempting to make a single page app using the web-api profile in Grails 3.
The only view Grails will load is the index page for the SPA. This can be either an index.html file or preferably an index.gsp.
My URLMappings looks like this: "/"(controller: '/index')
And I have a index.gsp in /grails-app/views/index.gsp
When I access localhost:8080/ I get a 404 back.
Any ideas? I've tried a few ways now and feel like it's something obvious that I'm just overlooking.
Thanks in advance
Upvotes: 0
Views: 622
Reputation: 1
No, they don't.
As you can read on the docs
grails create-app my-api --profile rest-api
Will create an application that has
Few plugins than the default Grails plugin (no GSP, no Asset Pipeline, Nothing HTML related)
Please, note: wep-api is now rest-api
http://docs.grails.org/latest/guide/webServices.html#restProfile
Upvotes: 0
Reputation: 7556
Suppose you have a controller as below:
class MyController{
def index(){
render "hello world!!"
}
}
you must write url mapping as below:
"/"(controller:'my',action:'index')
Upvotes: 0