This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pika, os, time | |
| time.sleep(30) # Wait for RabbitMQ container to initialize | |
| rabbitmq_host = os.getenv('RABBITMQ_HOST') | |
| rabbitmq_credentials = pika.PlainCredentials(os.getenv('RABBITMQ_USERNAME'),os.getenv('RABBITMQ_PASSWORD')) | |
| connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host,credentials=rabbitmq_credentials)) | |
| channel = connection.channel() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pika, os, time | |
| time.sleep(30) # Wait for RabbitMQ container to initialize | |
| rabbitmq_host = os.getenv('RABBITMQ_HOST') | |
| rabbitmq_credentials = pika.PlainCredentials(os.getenv('RABBITMQ_USERNAME'),os.getenv('RABBITMQ_PASSWORD')) | |
| connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host,credentials=rabbitmq_credentials)) | |
| channel = connection.channel() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, jsonify | |
| import requests | |
| from datetime import datetime | |
| from flask_cors import CORS | |
| app = Flask(__name__) | |
| CORS(app) | |
| ESB_URL = "http://esb:5000/message" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # loans_service.py | |
| from flask import Flask, jsonify, request | |
| import json | |
| import os | |
| from datetime import datetime | |
| import requests | |
| app = Flask(__name__) | |
| # Configuration for shared data persistence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, jsonify | |
| from flask_cors import CORS | |
| import requests | |
| app = Flask(__name__) | |
| CORS(app) | |
| # Mapa de servicios | |
| SERVICE_MAP = { | |
| "BooksService": "http://books:5000", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # books_service.py | |
| from flask import Flask, jsonify, request | |
| app = Flask(__name__) | |
| books = [ | |
| {"id": 1, "title": "Don Quijote", "status": "available"}, | |
| {"id": 2, "title": "Cien años de soledad", "status": "available"}, | |
| {"id": 3, "title": "El principito", "status": "available"} | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, jsonify | |
| from flask_cors import CORS | |
| import requests | |
| app = Flask(__name__) | |
| CORS(app) | |
| # Mapa de servicios | |
| SERVICE_MAP = { | |
| "BooksService": "http://books:5000", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, jsonify | |
| import requests | |
| from datetime import datetime | |
| from flask_cors import CORS | |
| app = Flask(__name__) | |
| CORS(app) | |
| ESB_URL = "http://esb:5000/message" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, request, Response | |
| import requests | |
| from flask_cors import CORS | |
| app = Flask(__name__) | |
| CORS(app) | |
| # Service registry (routing only) | |
| SERVICES = { | |
| "books": "http://books:5000/books", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, jsonify, request | |
| import json | |
| import os | |
| app = Flask(__name__) | |
| # Service-owned storage | |
| DATA_DIR = "/data" | |
| USERS_FILE = os.path.join(DATA_DIR, "users.json") |
NewerOlder