Logging is the process of recording application actions and state to a secondary interface.
- It tells what happened in the application at what time.
# WHAT IS REST? | |
REST stands for Representational State Transfer. It’s a software architectural style for implementing web services. Web services implemented using the REST architectural style are known as the RESTful Web services. | |
In REST we transfer representation of a resource in a particular state at a point in time, that's why it is called REST. | |
For example: GET /v1/articles/123, transfer article 123 representation in JSON format in the state when API is hit. | |
REST use HTTP as a communication protocol, HTTP is a stateless protocol so should be REST. It means two REST APIs should be treated completely independent on server, both APIs should be authenticated and authorized, don't store anything from the first API call in server memory to be used by further API calls. | |
RESTful APIs are written for consumers. The name and structure of URIs should convey meaning to those consumers. Although your internal data models may map neatly to resources, it isn't necessarily a one-to-one mapping. The key here is to no |
function searchBlogByTitle(query: string, itemsPerPage: number, lastEvaluatedKey?: string): Promise<any> { | |
const FIXED_ID_FOR_SEARCH_GSI = "1233421345223"; | |
let params: AWS.DynamoDB.DocumentClient.QueryInput = { | |
TableName: "Blog", | |
IndexName: "BlogSearch", | |
KeyConditionExpression: "fixedIdForSearchGSI = :pkv", | |
FilterExpression: "contains(titleInLowerCase, :titleV)", | |
ExpressionAttributeValues: { | |
":pkv": FIXED_ID_FOR_SEARCH_GSI, | |
":titleV": query.toLocaleLowerCase() |