HenriqueLopesDev /
serverless-todo-api
API Serverless criada com AWS Lambda, Typescript e DynamoDB. Onde é possível gerenciar tarefas (To-do) e fazer operações CRUD.
27/100 healthLoading repository data…
HenriqueLopesDev / repository
API Serverless criada com AWS Lambda, Typescript e DynamoDB. Onde é possível armazenar e recuperar informações fictícias de professores (nome, matéria e o curso).
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This project has been generated using the aws-nodejs-typescript template from the Serverless framework.
For detailed instructions, please refer to the documentation.
Depending on your preferred package manager, follow the instructions below to deploy your project.
Requirements: NodeJS
lts/fermium (v.14.15.0). If you're using nvm, runnvm useto ensure you're using the same Node version in local and in your lambda's runtime.
npm i to install the project dependenciesnpx sls deploy to deploy this stack to AWSyarn to install the project dependenciesyarn sls deploy to deploy this stack to AWSThis template contains a single lambda function triggered by an HTTP request made on the provisioned API Gateway REST API /hello route with POST method. The request body must be provided as application/json. The body structure is tested by API Gateway against src/functions/hello/schema.ts JSON-Schema definition: it must contain the name property.
/hello with any other method than POST will result in API Gateway returning a 403 HTTP error codePOST request to /hello with a payload not containing a string property named name will result in API Gateway returning a 400 HTTP error codePOST request to /hello with a payload containing a string property named name will result in API Gateway returning a 200 HTTP status code with a message saluting the provided name and the detailed event processed by the lambda:warning: As is, this template, once deployed, opens a public endpoint within your AWS account resources. Anybody with the URL can actively execute the API Gateway endpoint and the corresponding lambda. You should protect this endpoint with the authentication method of your choice.
In order to test the hello function locally, run the following command:
npx sls invoke local -f hello --path src/functions/hello/mock.json if you're using NPMyarn sls invoke local -f hello --path src/functions/hello/mock.json if you're using YarnCheck the sls invoke local command documentation for more information.
Copy and replace your url - found in Serverless deploy command output - and name parameter in the following curl command in your terminal or in Postman to test your newly deployed application.
curl --location --request POST 'https://myApiEndpoint/dev/hello' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Frederic"
}'
The project code base is mainly located within the src folder. This folder is divided in:
functions - containing code base and configuration for your lambda functionslibs - containing shared code base between your lambdas.
├── src
│ ├── functions # Lambda configuration and source code folder
│ │ ├── hello
│ │ │ ├── handler.ts # `Hello` lambda source code
│ │ │ ├── index.ts # `Hello` lambda Serverless configuration
│ │ │ ├── mock.json # `Hello` lambda input parameter, if any, for local invocation
│ │ │ └── schema.ts # `Hello` lambda input event JSON-Schema
│ │ │
│ │ └── index.ts # Import/export of all lambda configurations
│ │
│ └── libs # Lambda shared code
│ └── apiGateway.ts # API Gateway specific helpers
│ └── handlerResolver.ts # Sharable library for resolving lambda handlers
│ └── lambda.ts # Lambda middleware
│
├── package.json
├── serverless.ts # Serverless service file
├── tsconfig.json # Typescript compiler configuration
├── tsconfig.paths.json # Typescript paths
└── webpack.config.js # Webpack configuration
event.body property, originally passed as a stringified JSON, to its corresponding parsed objectserverless.ts service fileAny tsconfig.json can be used, but if you do, set the environment variable TS_NODE_CONFIG for building the application, eg TS_NODE_CONFIG=./tsconfig.app.json npx serverless webpack
Selected from shared topics, language and repository description—not editorial ratings.
HenriqueLopesDev /
API Serverless criada com AWS Lambda, Typescript e DynamoDB. Onde é possível gerenciar tarefas (To-do) e fazer operações CRUD.
27/100 healthandersonkaiti /
Lambdas criadas com Serverless Framework durante o "esquenta" do JStack LAB.
31/100 healthwillianVini-dev /
Neste projeto, será criada uma aplicação de e-commerce serverless com TypeScript e Node.js, utilizando serviços AWS como Lambda, API Gateway, DynamoDB, S3, SNS, SQS, e mais. A aplicação incluirá APIs REST e WebSocket, gerenciamento de infraestrutura com AWS CDK e práticas de IaC para automação e escalabilidade.