Assorted reference information
Uses 3 numbers, seperated by a period. e.g. 1.2.4
Breaking changes . New features . Bug fixes
- Express JS is used to handle HTTP logic
- Express middleware is a function which runs between the request and response.
- Express-Validators validates routes according to business rules
- EJS is a templating engine for injecting data into View files
- Express.json(): (Built-in) Parses incoming requests with JSON payloads
- Express.urlencoded(): (Built-in) Parses incoming requests with URL-encoded payloads
- Express.static(): (Built-in) Serves static files
- Morgan: HTTP request logger
- Cors: Enables cross-origin resource sharing
- Helmet: Secdures express apps by setting HTTP headers
| Method | Code | Purpose |
|---|---|---|
| GET | 200 | Fetch data |
| POST | 201 | Create data |
| PUT | 200 | Update record |
| PATCH | 204 | Update partial record |
| DELETE | 204 | Deleted record |
| ERROR | 400 | Bad request |
| ERROR | 500 | Signifies server error |
Code Implementation 200 Get record or record 200 Full record updated 201 Record added 202 Request received for processing, but not completed 204 Partial record update completed (No content returned) 204 Record deleted (No content returned) 206 Partial content 300 Redirect 400 Rejected API call - missing required header 401 Unauthorised request 403 Forbidden 404 Record not found 408 Request timeout 409 Rejected API call - Operation in progress 422 Rejected API call - Invalid header/data sent 500 Internal server error 503 Service / Server unavailable (e.g maintenance)
Can be server, client, or both.
Model : Data that is required to populate a page or control (partial)
View : The page, or partial page, which will display the information. (Often EJS)
Controller : Needed to render model data to a view, or partial. Which handles any API calls for CRUD or to external sites, and for managing any dynamic functionality on the web page.
- Enables communications between software systems
- Defines structured rules for integration
- Represents specific API functionality path
- Unique URL for accessing resources
- Enable standardised CRUD operation handling
- Define action performed on resources
- Client sends structured data payload
- Includes headers, parameters, and body
- Server returns processed result data
- Contains status code, and payload
- Indicate outcome of API request
- Help identify errors and success
- Verifies identity of requesting entity
- Uses token keys or credentials
- Transfers additional data within requests
- Support filtering, sorting, and pagination
- Carry metadata about HTTP requests
- Specify content type and authorisation
- Determines user access permission levels
- Enforces role-based access control (RBAC)
- Restricts the number of allowed requests
- Prevents abuse and server overload
- Unique identifier for client access
- Used for simple authentication mechanisms
- Lightweight structured data exchange format
- Commonly used in REST APIs
- Sends automated event triggered callbacks to a URL
- Enables real-time system updates
- Secure delegated access authorisation framework
- Issues tokens for controlled access
