Skip to content

felipedmsantos95/lambda-apigw-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda APIGW Template

My personal template for Lambda APIGW applications, this project was made in Node.js with TypeScript using Express as the HTTP framework, adapted to run in AWS Lambda with integration to API Gateway. Locally, it uses the Serverless Framework with serverless-offline to simulate the AWS environment.


🚀 Technologies

  • Node.js 20+
  • TypeScript
  • Express
  • AWS Lambda (via @codegenie/serverless-express)
  • Serverless Framework
  • serverless-offline (to run locally)

📦 Prerequisites

Before getting started, you need to have the following installed:


🔧 Installation

Clone the repository and install the dependencies:

git clone https://github.com/felipedmsantos95/lambda-apigw-template.git
cd lambda-apigw-template
yarn

▶️ Running Locally

The project uses Serverless Offline to simulate the behavior of the API Gateway and Lambda locally.

Compile the project and start the server:

yarn offline

This command compiles the TypeScript code and runs Serverless Offline without the stage suffix (/dev, /local), allowing direct access via /.


🌐 Testing the API

Once the project is running, access:

GET http://localhost:3000/

Expected response:

Hello from Express + AWS Lambda using @codegenie!

📁 Folder Structure

src/
├── index.ts       # Local entry point
├── lambda.ts      # AWS Lambda handler
├── server.ts      # Separate Express app (reusable)
tsconfig.json      # TypeScript configuration
serverless.yml     # Serverless Framework configuration

💡 Notes

  • To simulate other endpoints, add new routes in src/server.ts.
  • The src/lambda.ts file transforms Express into an AWS Lambda handler.
  • The serverless.yml file is configured to work with the serverless-offline plugin.

🤝 Contributing

Feel free to open PRs, issues, or adapt the template to your needs!


About

My personal template for Lambda APIGW applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published