From the course: Code Clinic: Ruby

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

API

API

From the course: Code Clinic: Ruby

Start my 1-month free trial

API

Over the course of the last several movies, we've completed our command line program. We now have a program that will successfully go out to the remote web server. Bring back the measurement results, calculate the median and the mean and return those to the user on the command line. Now what we want to do is take that same functionality and instead of having it accessible by the command line. We want to make it accessible via an API. An API is short for Application Programming Interface, and it's basically a fancy way of saying that we're going to give people the ability to interface with our program. In this case remotely over the web. That's a specific kind of API, and it requires that we're going to need a web server. The web server's going to listen for those requests to come in, and then it will respond back to the user across the web as well. The web server can't talk directly to our Ruby code. Web servers don't have that amount of knowledge built into them. So instead we need…

Contents