This course, Creating an API with Rails, will enable you to create elegant, predictable, and fast APIs for your app that are extensible and secure. First, you will explore how to authenticate the APIs that your app is exposing. You will see both basic HTTP authentication and the JWT token authentication approach. Next, you will learn how to provide different response formats like HTML, JSON, etc from a controller. You will then learn how to serialize the models in your app to JSON and how to use the Jbuilder tool to create complex JSON responses that involve multiple resources all the while keeping the code clean and easy to modify. Finally, you will learn how to make your APIs future proof by adding support for pagination, API versioning, and alternative ways of querying and serving data using tools like GraphQL and Graphiti. When you are finished with this course, you will be very comfortable creating APIs in Rails that can not only support multiple complex response formats but are secure, elegant, fast, and extensible.
Overview
This course, Creating an API with Rails, will enable you to create elegant, predictable, and fast APIs for your app that are extensible and secure. First, you will explore how to authenticate the APIs that your app is exposing. You will see both basic HTTP authentication and the JWT token authentication approach. Next, you will learn how to provide different response formats like HTML, JSON, etc from a controller. You will then learn how to serialize the models in your app to JSON and how to use the Jbuilder tool to create complex JSON responses that involve multiple resources all the while keeping the code clean and easy to modify. Finally, you will learn how to make your APIs future proof by adding support for pagination, API versioning, and alternative ways of querying and serving data using tools like GraphQL and Graphiti. When you are finished with this course, you will be very comfortable creating APIs in Rails that can not only support multiple complex response formats but are secure, elegant, fast, and extensible.
Syllabus
- Course Overview 1min
- Creating API Authentication 21mins
- Serving Multiple Formats from a Controller 5mins
- Serializing Models to JSON 14mins
- Creating Complex JSON Responses Using JBuilder 16mins
- Implementing Pagination for an API Endpoint 8mins
- Enabling API Versioning for an Endpoint 13mins
- GraphQL and Graphiti as Alternatives for Rest APIs 31mins
Taught by
Nitin Singh