Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Microservices
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Griffin, Matt J Dr (PG/R - Comp Sci & Elec Eng)
Microservices
Commits
cd15085f
Commit
cd15085f
authored
9 years ago
by
Umer Mansoor
Browse files
Options
Downloads
Patches
Plain Diff
added GET method to Flask routes
parent
24f52332
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
services/bookings.py
+3
-3
3 additions, 3 deletions
services/bookings.py
services/movies.py
+3
-3
3 additions, 3 deletions
services/movies.py
services/showtimes.py
+3
-3
3 additions, 3 deletions
services/showtimes.py
services/user.py
+5
-5
5 additions, 5 deletions
services/user.py
with
14 additions
and
14 deletions
services/bookings.py
+
3
−
3
View file @
cd15085f
...
...
@@ -10,7 +10,7 @@ with open("{}/database/bookings.json".format(root_dir()), "r") as f:
bookings
=
json
.
load
(
f
)
@app.route
(
"
/
"
)
@app.route
(
"
/
"
,
methods
=
[
'
GET
'
]
)
def
hello
():
return
nice_json
({
"
uri
"
:
"
/
"
,
...
...
@@ -21,12 +21,12 @@ def hello():
})
@app.route
(
"
/bookings
"
)
@app.route
(
"
/bookings
"
,
methods
=
[
'
GET
'
]
)
def
booking_list
():
return
nice_json
(
bookings
)
@app.route
(
"
/bookings/<username>
"
)
@app.route
(
"
/bookings/<username>
"
,
methods
=
[
'
GET
'
]
)
def
booking_record
(
username
):
if
username
not
in
bookings
:
raise
NotFound
...
...
This diff is collapsed.
Click to expand it.
services/movies.py
+
3
−
3
View file @
cd15085f
...
...
@@ -10,7 +10,7 @@ with open("{}/database/movies.json".format(root_dir()), "r") as f:
movies
=
json
.
load
(
f
)
@app.route
(
"
/
"
)
@app.route
(
"
/
"
,
methods
=
[
'
GET
'
]
)
def
hello
():
return
nice_json
({
"
uri
"
:
"
/
"
,
...
...
@@ -20,7 +20,7 @@ def hello():
}
})
@app.route
(
"
/movies/<movieid>
"
)
@app.route
(
"
/movies/<movieid>
"
,
methods
=
[
'
GET
'
]
)
def
movie_info
(
movieid
):
if
movieid
not
in
movies
:
raise
NotFound
...
...
@@ -31,7 +31,7 @@ def movie_info(movieid):
return
nice_json
(
result
)
@app.route
(
"
/movies
"
)
@app.route
(
"
/movies
"
,
methods
=
[
'
GET
'
]
)
def
movie_record
():
return
nice_json
(
movies
)
...
...
This diff is collapsed.
Click to expand it.
services/showtimes.py
+
3
−
3
View file @
cd15085f
...
...
@@ -10,7 +10,7 @@ with open("{}/database/showtimes.json".format(root_dir()), "r") as f:
showtimes
=
json
.
load
(
f
)
@app.route
(
"
/
"
)
@app.route
(
"
/
"
,
methods
=
[
'
GET
'
]
)
def
hello
():
return
nice_json
({
"
uri
"
:
"
/
"
,
...
...
@@ -21,12 +21,12 @@ def hello():
})
@app.route
(
"
/showtimes
"
)
@app.route
(
"
/showtimes
"
,
methods
=
[
'
GET
'
]
)
def
showtimes_list
():
return
nice_json
(
showtimes
)
@app.route
(
"
/showtimes/<date>
"
)
@app.route
(
"
/showtimes/<date>
"
,
methods
=
[
'
GET
'
]
)
def
showtimes_record
(
date
):
if
date
not
in
showtimes
:
raise
NotFound
...
...
This diff is collapsed.
Click to expand it.
services/user.py
+
5
−
5
View file @
cd15085f
...
...
@@ -11,7 +11,7 @@ with open("{}/database/users.json".format(root_dir()), "r") as f:
users
=
json
.
load
(
f
)
@app.route
(
"
/
"
)
@app.route
(
"
/
"
,
methods
=
[
'
GET
'
]
)
def
hello
():
return
nice_json
({
"
uri
"
:
"
/
"
,
...
...
@@ -24,12 +24,12 @@ def hello():
})
@app.route
(
"
/users
"
)
@app.route
(
"
/users
"
,
methods
=
[
'
GET
'
]
)
def
users_list
():
return
nice_json
(
users
)
@app.route
(
"
/users/<username>
"
)
@app.route
(
"
/users/<username>
"
,
methods
=
[
'
GET
'
]
)
def
user_record
(
username
):
if
username
not
in
users
:
raise
NotFound
...
...
@@ -37,7 +37,7 @@ def user_record(username):
return
nice_json
(
users
[
username
])
@app.route
(
"
/users/<username>/bookings
"
)
@app.route
(
"
/users/<username>/bookings
"
,
methods
=
[
'
GET
'
]
)
def
user_bookings
(
username
):
"""
Gets booking information from the
'
Bookings Service
'
for the user, and
...
...
@@ -77,7 +77,7 @@ def user_bookings(username):
return
nice_json
(
result
)
@app.route
(
"
/users/<username>/suggested
"
)
@app.route
(
"
/users/<username>/suggested
"
,
methods
=
[
'
GET
'
]
)
def
user_suggested
(
username
):
"""
Returns movie suggestions. The algorithm returns a list of 3 top ranked
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment