Concepts and terms
This document covers terminology used throughout the rest of the documentation.
API
An HTTP endpoint.
API Declaration
An API declaration describes an HTTP endpoint, along with its payload and expected response.
The APIDeclaration class in papupata allows for declaring APIs on the same host so that they share configuration.
Middleware
One or more layers of code between and HTTP server and the business logic. Typically used for things like authentication, authorization, logging and error handling.
Calling/invoking APIs
The act of making an HTTP request, sending a payload and receiving response.
Implementing APIs
The act of providing business logic connected to an HTTP server to process the inputs of an API to produce any necessary side effects and a response.
Client
Any party that uses papupata to make HTTP requests. It is not necessarily a browser -- it is not uncommon for node processes to make requests to external systems, in which case they are clients as well.
Server
A HTTP (or HTTPs) server that forwards requests for papupata to handle.
Request
A call to an API. Initialized from the client and processed on the server.
Mocking
Substituting production code and logic with another, typically simpler one for the purpose of testing.
express
A node.js library for implementing http server. See https://expressjs.com/. At this time papupata natively supports only express as the http server for implementing APIs.
body, query parameter
Parts of an HTTP request. They along with path parameters are the payload for a request.
path parameter
A parametrized part of the path in URLs. For example, in
API.declareGetAPI('/get/document/:id')/*...*/
the :id signifies a path parameter, and is replaced with the value for the parameter when invoking the API.