View on GitHub

reading-notes

Daily Reading 13

More CRUD

CRUD Basics

Which HTTP method would you use to update a record through an API?

PUT.

Which REST methods require an ID parameter?

PUT and DELETE. (READ can use an ID, but does not require it.)

What’s the relationship between REST and CRUD?

REST is the method and formatting for commands that computers can use to communicate with each other. The client/server communication. CRUD can exist within a REST environment, but is a function for databases, not a client/server handshake.

If you had to describe the process of creating a RESTful API in 5 steps, what would they be?

import express and cors. set up route commands, each with a /domain and taking the arguments (req,res,next) create functions that handle a GET request to your routes, a PUT request, a DELETE request, and a READ request. Ensure that IDs can be passed into the end of your / routes for PUT and DELETE to know what to modify. set a localhost port in your ENV file, and run nodemon to get it hosted on localhost:YOURPORT.

Back To Main Page.