10.1.6 The REST Profile - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 3.1.6
10.1.6 The REST Profile
Since Grails 3.1, Grails supports a tailored profile for creating REST applications that provides a more focused set of dependencies and commands.To get started with the REST profile create an application with by specifyingrest-api
as the name of the profile:$ grails create-app my-api --profile rest-api
- Default set of commands for creating and generating REST endpoints
- Defaults to using JSON views for rendering responses (see the next section)
- Few plugins than the default Grails plugin (no GSP, no Asset Pipeline, Nothing HTML related)
grails-app/views
directory that there are *.gson
files for rendering the default index page and as well as any 404 and 500 errors.If you issue the following set of commands:$ grails create-domain-class book $ grails generate-all my.api.Book