Posts

Showing posts with the label api gateway

AWS Lambda User Guide

Image
Introduction AWS Lambda is a leading "Serverless" computing service from Amazon Web Services (AWS). It allows you to run your code without having to manage or provision any servers. Simply put, instead of renting a virtual computer (like EC2), installing an OS, and maintaining it, you just upload your code. Lambda handles everything else—from activating resources and executing the code to shutting everything down once the job is done. Key Advantages of AWS Lambda No Server Management (Serverless): You don't need to worry about OS updates, security patches, or hardware maintenance. AWS handles all the heavy lifting of infrastructure operations. Auto-scaling: Lambda reacts instantly to the number of requests. If there is 1 request, it runs once; if there are 10,000 simultaneous requests, it automatically scales up to handle them in parallel without any extra configuration. Cost Optimization (Pay-as-you-go): This is the best part. You only pay for the time your code is actua...

Create API Gateway with fast-gateway

Image
Introduction In this article, I will guide you on how to use fast-gateway to deploy a simple API Gateway on NodeJS along with express . The advantage of an API Gateway is that it acts as an intermediary layer to hide the rest of the system, including services, commonly used in Microservices architecture. Example Usage This is the Microservices model after deployment: First, install the package yarn add fast-gateway Next, define the ports that will be used. import * as express from 'express' import * as gateway from 'fast-gateway' const portGateway = 5000 const portService1 = 5001 const portService2 = 5002 Define service 1 as follows: const startService1 = (): void => { const app = express () app . get ( '/list' , ( req , res ) => { const items = [ { id: 1 , name: 'service 1 value 1' , }, { id: 2 , name: 'service 1 value 2' , }, ] re...