ExpressJs — API Gateway Integration
An API gateway acts as a single entry point for clients and routes requests to different microservices, handling authentication, rate-limiting, and logging.
const express = require('express');
const app = express();
const proxy = require('http-proxy-middleware');
app.use('/users', proxy.createProxyMiddleware({ target: 'http://localhost:4000', changeOrigin: true }));
app.listen(3000, () => console.log('API Gateway running on port 3000'));