Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
codecodecoder78 committed Sep 25, 2021
1 parent 5a67d02 commit 2b830aa
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Profiles/ProfilesAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Profile API here
from flask import Blueprint
import sys
from db import db
sys.path.append("../")

profiles_api = Blueprint("profiles", __name__)
Binary file added Profiles/__pycache__/ProfilesAPI.cpython-38.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions Scores/ScoresAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Score API here
from flask import Blueprint
import sys
from db import db
sys.path.append("../")

scores_api = Blueprint("scores", __name__)
Binary file added Scores/__pycache__/ScoresAPI.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/db.cpython-38.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions db.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Simulated db
db = [{
"name": "Nobel",
"scores": [1, 2, 3, 4, 5]
}, {
"name": "Richard",
"scores": [5, 4, 3, 2, 1]
}, {
"name": "Hui Hui",
"scores": [9, 29, 34]
}]
16 changes: 16 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from Scores.ScoresAPI import scores_api
from Profiles.ProfilesAPI import profiles_api
from flask import Flask
from db import db


# Write your flask code here

app = Flask(__name__)

app.register_blueprint(profiles_api, url_prefix="/profiles")
app.register_blueprint(scores_api, url_prefix="/users")


if __name__ == "__main__":
app.run("0.0.0.0", port=8080)

0 comments on commit 2b830aa

Please sign in to comment.