What’s the difference between PUT and PATCH
The main difference between the PUT and PATCH method is that the PUT method uses the request URI to supply a modified version of the requested resource which replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource.
3 services or tools that allow you to “mock” an API for development like json-server
- MockServer
- Beeceptor
- Mockoon
apidoc vs swagger for node app
Swagger allows you define the range of responses as 1XX, 2XX, …5XX. If you provide the explicit code (i.e. 404) that will take precedence over the blanket request (in this case 4XX). Each response status requires a description. API specs do not necessarily need to cover all possible codes, but known error codes like 404 must be addressed.
APIDOC.js you can also define the errors in groups, if you do not provide the specific code the default error Error 4xx is thrown. You can set the title and description of the errror with @apiDefine
Compare and contrast SOAP and ReST
The difference is: SOAP is a XML-based message protocol, while REST is an architectural style. SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data. SOAP invokes services by calling RPC method, REST just simply calls services via URL path.
| Term | Definition |
|---|---|
| Web Server | System of one or more computers that accepts incoming HTTP requests and sends corresponding HTTP responses; primary function is to deliver web contents/resources to the client (requestor). “Web Server” can refer to the hardware (computer storing web resources and software) or the software itself(that controls how users interact with hosted files, minimum functionality HTTP) |
| Express | Express is a Node framework that simplifies HTTP verbs and allows for concise creation of HTTP verb handlers, simple integration with different view engines (i.e. porting information into front end templates), creates common settings such as port to use for connecting, and allows for additional request processing (middleware) to be inserted into request handling. It is unopinionated, meaning that you can structure it in various ways and use many different middleware options in myriad configurations. |
| Routing | Routing is how the client request is connected to the code they will receive |
| (WRRC) | This is how information flows through a web app: client opens brower/enters url, request gets sent to the server which takes the url request, server follows it’s routing to serve back the requested web document and passes it to the view, the view renders the information in the desired format back to the client in their browser |