Microservices With Node Js And React Download Page

api-gateway: build: ./api-gateway ports: - "5000:5000" depends_on: - user-service - product-service

const redis = require('redis'); const publisher = redis.createClient(); app.post('/users', async (req, res) => { const newUser = new User(req.body); await newUser.save(); microservices with node js and react download

npm install express http-proxy-middleware api-gateway: build:

const subscriber = redis.createClient(); subscriber.subscribe('user-created', (message) => { const user = JSON.parse(message); console.log(`Send welcome email to ${user.email}`); // Integrate with email provider here }); 5.1 Create React App cd frontend npx create-react-app react-app cd react-app npm install axios 5.2 Fetch Data from the API Gateway src/App.js const publisher = redis.createClient()

import React, { useState, useEffect } from 'react'; import axios from 'axios'; const API_GATEWAY = 'http://localhost:5000';