Skip to content

Commit

Permalink
Create app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 10, 2024
1 parent 75967f6 commit 8cf70c9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions blockchain_integration/pi_network/pi-stablecoin/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from flask import Flask, jsonify
from blockchain import BlockchainService
from transaction import TransactionService
from user import UserService

app = Flask(__name__)

blockchain_service = BlockchainService()
transaction_service = TransactionService()
user_service = UserService()

@app.route('/blockchain', methods=['GET'])
def get_blockchain():
return jsonify(blockchain_service.get_blockchain())

@app.route('/transaction', methods=['GET'])
def get_transaction():
return jsonify(transaction_service.get_transactions())

@app.route('/user', methods=['GET'])
def get_user():
return jsonify(user_service.get_users())

if __name__ == '__main__':
app.run(debug=True)

0 comments on commit 8cf70c9

Please sign in to comment.