Recall & Review
beginner
What does it mean to create an API-only Rails application?
It means setting up a Rails app that only serves data through APIs, without rendering HTML views or using frontend features like layouts or assets.
Click to reveal answer
beginner
Which command creates a new Rails app configured as API-only?
rails new myapp --api
Click to reveal answer
intermediate
Why does an API-only Rails app skip middleware like session or cookies by default?
Because APIs usually don't need browser sessions or cookies, so skipping them makes the app lighter and faster.
Click to reveal answer
intermediate
How do you add middleware back if needed in an API-only Rails app?
You can add middleware manually in config/application.rb using config.middleware.use followed by the middleware class.
Click to reveal answer
beginner
What is the default response format in an API-only Rails app?
JSON is the default response format, as APIs usually send data in JSON to clients.
Click to reveal answer
Which flag creates a Rails app optimized for APIs only?
✗ Incorrect
The --api flag sets up Rails with API-only defaults.
What is NOT included by default in an API-only Rails app?
✗ Incorrect
Session middleware is skipped by default in API-only apps.
How do API-only Rails apps usually send data to clients?
✗ Incorrect
JSON is the common format for API data exchange.
If you want to add cookie support in an API-only Rails app, what should you do?
✗ Incorrect
You add middleware manually in config/application.rb.
Which of these is a benefit of API-only Rails apps?
✗ Incorrect
Skipping unneeded features makes API apps faster.
Explain how to create and configure a new API-only Rails application.
Think about the command and what changes in app behavior.
You got /3 concepts.
Describe how middleware works differently in API-only Rails apps compared to full-stack apps.
Focus on what middleware is included or excluded.
You got /3 concepts.