```rails new my_api --api````
*Configure your application to start with a more limited set of middleware than normal. Specifically, it will not include any middleware primarily useful for browser applications (like cookies support) by default. *Make ApplicationController inherit from ActionController::API instead of ActionController::Base. As with middleware, this will leave out any Action Controller modules that provide functionalities primarily used by browser applications. *Configure the generators to skip generating views, helpers and assets when you generate a new resource.
```config.api_only = true````
- In config/application.rb for existing apps
```class ApplicationController < ActionController::API````
- In application_controller.rb
ActionDispatch::Request#params
- take parameters from the client in the JSON format and make them available in your controller inside params
Modules to add in ApplicationController or individual controllers
AbstractController::Translation
: Support for the l and t localization and translation methods.
ActionController::HttpAuthentication::Basic
(or Digest or Token): Support for basic, digest or token HTTP authentication.
AbstractController::Layouts
: Support for layouts when rendering.
ActionController::MimeResponds
: Support for respond_to.
ActionController::Cookies
: Support for cookies, which includes support for signed and encrypted cookies. This requires the cookies middleware.