Skip to content
View mojineel's full-sized avatar

Block or report mojineel

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
mojineel/README.md

+-----------------+        +-----------------+ |    API Gateway   | <----> |  Authentication  | +-----------------+        +-----------------+          |                           |          |                           |          v                           v +-----------------+        +-----------------+ |    Service A    | <----> |    Service B    | +-----------------+        +-----------------+          |                           |          v                           v +-----------------+        +-----------------+ |    Database A   |        |    Database B   | +-----------------+        +-----------------+

Dockerfile for the service

FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "app.py"] from flask import Flask, jsonify, request from flask_restful import Api, Resource import os

app = Flask(name) api = Api(app)

class HealthCheck(Resource):     def get(self):         return jsonify({"status": "healthy"})

class DataService(Resource):     def get(self, key):         value = os.getenv(key, "Not Found")         return jsonify({key: value})

    def post(self, key):         value = request.json.get("value")         os.environ[key] = value         return jsonify({key: value})

api.add_resource(HealthCheck, '/health') api.add_resource(DataService, '/data/string:key')

if name == "main":     app.run(host='0.0.0.0', port=5000) from flask import Flask, request, jsonify import requests

app = Flask(name) from flask import Flask, jsonify from flask_restful import Api, Resource

app = Flask(name) api = Api(app)

class HelloWorld(Resource):     def get(self):         return jsonify({"message": "Hello from Service A!"})

api.add_resource(HelloWorld, '/')

if name == "main":     app.run(host='0.0.0.0', port=5001) from flask import Flask, jsonify from flask_restful import Api, Resource

app = Flask(name) api = Api(app)

class GoodbyeWorld(Resource):     def get(self):         return jsonify({"message": "Goodbye from Service B!"})

api.add_resource(GoodbyeWorld, '/') version: '3'

services:   api_gateway:     build:       context: .       dockerfile: Dockerfile     ports:       - "5000:5000"

  service_a:     build:       context: .       dockerfile: Dockerfile     ports:       - "5001:5001"

  service_b:     build:       context: .       dockerfile: Dockerfile     ports:       - "5002:5002"*******/********************

if name == "main":     app.run(host='0.0.0.0', port=5002)

Popular repositories Loading

  1. wpt wpt Public

    Forked from web-platform-tests/wpt

    Test suites for Web platform specs — including WHATWG, W3C, and others

    HTML

  2. gitignore gitignore Public

    Forked from github/gitignore

    A collection of useful .gitignore templates

  3. greasyfork greasyfork Public

    Forked from greasyfork-org/greasyfork

    An online repository of user scripts.

    Ruby

  4. Omidgh313-github.io Omidgh313-github.io Public

    Forked from Omidgh313/Omidgh313-github.io

    HTML

  5. shareable shareable Public

    Forked from trycourier/shareable

    This repository hosts publicly-available content

  6. swdc-vscode swdc-vscode Public

    Forked from swdotcom/swdc-vscode

    Time-tracking plugin for Visual Studio Code

    TypeScript