JSON API
Last updated
Last updated
This recipe will help you to setup a basic JSON API response in your application.
First you need an amber project generated with or .
To create a JSON API from the command line, you simply need to use the . Or for quick reference, run:
And it will generate the following files:
This is a fully scaffolded JSON API.
If you don't need full CRUD, you can also create a custom JSON API.
Then in your routes file:
Alternatively you can use helper. Here you don't need to setup content_type
, however the requested path requires a .json
extension, by example /json_api.json
For a full CRUD example, see .
Also see and .