blog 308

Lane Garner
2 min readJan 4, 2021
Photo by Diego PH on Unsplash

Can you explain the purpose of each type of HTTP Request when using a RESTful web service?

GET- The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.

POST- The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

PUT- The PUT method replaces all current representations of the target resource with the request payload.

DELETE- The DELETE method deletes the specified resource.

What’s a test pyramid? How can you implement it when talking about HTTP APIs?

A test pyramid is a visual representation of the quantity of different types of tests. The tests with the most quantity is the base of the pyramid while those with the least form the smaller upper parts of the pyramid. When writing unit tests, there should be more low-level unit tests than high level end-to-end tests.

What is the “demultiplexer”?

This is a mechanism provided by modern operating systems to handle non-blocking I/O in an efficient way. It is called a synchronous event demultiplexer or an event notification interface.

What’s the difference between “blocking” and “non-blocking” functions?

Blocking functions in Node.js are when a process has to wait until a non-javascript operation completes. Non-blocking functions do not wait until the non-javascript operation completes.

What are the main security implementations within NodeJS?

The main security implementation we’ve used utilizing the .env file to hide sensitive data such as API keys. Another useful security feature is password hashing to avoid storing actual passwords in your DB.

--

--