forked from codecodecoder78/RHDEV-BE-2-flask
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a67d02
commit 2b830aa
Showing
7 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 not shown.
This file contains 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
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 not shown.
Binary file not shown.
This file contains 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
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] | ||
}] |
This file contains 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
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) |