An instagram infra abstraction created with a serverless architecture.
- Serverless framework
- Node.js
- Typescript
- AWS (DynamoDB, S3, Lambda, Cognito)
sls deployto deploy changes to AWS and get the list of endpoints created.
--region {name}sets the regions in which the infra will deploy.--stage {name}sets the stage environment. ie:dev,dev2,hml,prodetc.--param="level={levelName}sets the level of logs which should log on CloudWatch.
- Endpoints are created in
src/functionsfolder. each function, in each file, is a different endpoint. - The API configuration is on
serverless.ymlfile, onfunctionsblock.
- I'm using Hoppscotch to test the API, making simple requests adding data manually.
- I'm using Winston to manage logs with logs levels. As you can see in
serverless.ymlfile, there is a cli param called level (--param="level={levelName}") where you can inform which log level you want, setting an ENV variable. Soinfoanddebuglogs will only display if the ENV variable is set to do so, making the logs organized by the log levels you want.