An instagram infra abstraction created with a serverless architecture.
- Serverless framework
- Node.js
- Typescript
- AWS (DynamoDB, S3, Lambda, Cognito)
sls deploy
to 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
,prod
etc.--param="level={levelName}
sets the level of logs which should log on CloudWatch.
- Endpoints are created in
src/functions
folder. each function, in each file, is a different endpoint. - The API configuration is on
serverless.yml
file, onfunctions
block.
- 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.yml
file, there is a cli param called level (--param="level={levelName}"
) where you can inform which log level you want, setting an ENV variable. Soinfo
anddebug
logs will only display if the ENV variable is set to do so, making the logs organized by the log levels you want.