In this video, get an overview of the API’s route handlers and call the API from the client to have a functional application.
- [Instructor] In the previous video,…we learned how to write in API specifications.…In this video, we will build the API that we design.…In particular, we are going to look…at setting up the API routes.…We will access the database and the route handler…to get, insert, or update notes.…We will construct a response that…follows the REST API guidelines.…Finally, we will call the REST API…from the browser using ajax calls.…By the end of this video,…we should have a fully functional application.…
First, let's open index.js to add the API routes.…As we decided in the previous video,…we will be using a notes collection resource…and a notes element resource.…The collection resources will support…the GET and POST methods,…and the element resource will support…the PUT and DELETE methods.…Here, we define the four routes.…The collection GET route is defined here.…The collection POST is here.…Element PUT is here,…and element DELETE is here.…
Notice that in the routes,…we use the call followed by the name,…like call a new ID here.…
This Node.js course gives you an overview of a RESTful API and the logical steps of creating one. It explores three different APIs, focusing on their similarities and differences and how to effectively implement one. Instructor Saleh Hamadeh starts off by defining APIs, showing how they can be built on top of HTTP and listing the properties that make an API RESTful. Learn how to develop Twitter Notes, a sample web application that lets users leave notes for their Twitter friends. Use Twitter's API to implement a login flow and then design a web API. Additionally, get a closer look at several other real-world APIs, and learn some best practices to keep APIs secure, maintainable, and efficient.
- Identifying REST resources
- Setting up the development environment
- Consuming a RESTful API
- Creating an OAuth login request
- Getting an access token
- Saving data in MongoDB
- Building a RESTful API
- Testing user-perceived performance
- Looking at APIs in the real world
- Best practices for building RESTful APIs