Skip to content
Snippets Groups Projects
Commit 59083e69 authored by Sastry, Nishanth Prof (Comp Sci & Elec Eng)'s avatar Sastry, Nishanth Prof (Comp Sci & Elec Eng)
Browse files
parents
No related branches found
No related tags found
No related merge requests found
{
"chris_rivers": {
"20151201": [
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
]
},
"garret_heaton": {
"20151201": [
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
],
"20151202": [
"276c79ec-a26a-40a6-b3d3-fb242a5947b6"
]
},
"dwight_schrute": {
"20151201": [
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
],
"20151205": [
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"276c79ec-a26a-40a6-b3d3-fb242a5947b6"
]
}
}
\ No newline at end of file
{
"720d006c-3a57-4b6a-b18f-9b713b073f3c": {
"title": "The Good Dinosaur",
"rating": 7.4,
"director": "Peter Sohn",
"id": "720d006c-3a57-4b6a-b18f-9b713b073f3c"
},
"a8034f44-aee4-44cf-b32c-74cf452aaaae": {
"title": "The Martian",
"rating": 8.2,
"director": "Ridley Scott",
"id": "a8034f44-aee4-44cf-b32c-74cf452aaaae"
},
"96798c08-d19b-4986-a05d-7da856efb697": {
"title": "The Night Before",
"rating": 7.4,
"director": "Jonathan Levine",
"id": "96798c08-d19b-4986-a05d-7da856efb697"
},
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6": {
"title": "Creed",
"rating": 8.8,
"director": "Ryan Coogler",
"id": "267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
},
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6": {
"title": "Victor Frankenstein",
"rating": 6.4,
"director": "Paul McGuigan",
"id": "7daf7208-be4d-4944-a3ae-c1c2f516f3e6"
},
"276c79ec-a26a-40a6-b3d3-fb242a5947b6": {
"title": "The Danish Girl",
"rating": 5.3,
"director": "Tom Hooper",
"id": "276c79ec-a26a-40a6-b3d3-fb242a5947b6"
},
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab": {
"title": "Spectre",
"rating": 7.1,
"director": "Sam Mendes",
"id": "39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
}
}
\ No newline at end of file
{
"20151130": [
"720d006c-3a57-4b6a-b18f-9b713b073f3c",
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
],
"20151201": [
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6",
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab",
"a8034f44-aee4-44cf-b32c-74cf452aaaae"
],
"20151202": [
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"96798c08-d19b-4986-a05d-7da856efb697",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab",
"276c79ec-a26a-40a6-b3d3-fb242a5947b6"
],
"20151203": [
"720d006c-3a57-4b6a-b18f-9b713b073f3c",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
],
"20151204": [
"96798c08-d19b-4986-a05d-7da856efb697",
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6"
],
"20151205": [
"96798c08-d19b-4986-a05d-7da856efb697",
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"276c79ec-a26a-40a6-b3d3-fb242a5947b6",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
]
}
\ No newline at end of file
{
"chris_rivers" : {
"id": "chris_rivers",
"name": "Chris Rivers",
"last_active":1360031010
},
"peter_curley" : {
"id": "peter_curley",
"name": "Peter Curley",
"last_active": 1360031222
},
"garret_heaton" : {
"id": "garret_heaton",
"name": "Garret Heaton",
"last_active": 1360031425
},
"michael_scott" : {
"id": "michael_scott",
"name": "Michael Scott",
"last_active": 1360031625
},
"jim_halpert" : {
"id": "jim_halpert",
"name": "Jim Halpert",
"last_active": 1360031325
},
"pam_beesly" : {
"id": "pam_beesly",
"name": "Pam Beesly",
"last_active": 1360031225
},
"dwight_schrute" : {
"id": "dwight_schrute",
"name": "Dwight Schrute",
"last_active": 1360031202
}
}
\ No newline at end of file
from services import root_dir, nice_json
from flask import Flask
from werkzeug.exceptions import NotFound
import json
import os
app = Flask(__name__)
with open("{}/database/movies.json".format(os.getcwd()), "r") as f:
movies = json.load(f)
@app.route("/", methods=['GET'])
def hello():
return nice_json({
"uri": "/",
"subresource_uris": {
"movies": "/movies",
"movie": "/movies/<id>"
}
})
@app.route("/movies/<movieid>", methods=['GET'])
def movie_info(movieid):
if movieid not in movies:
raise NotFound
result = movies[movieid]
result["uri"] = "/movies/{}".format(movieid)
return nice_json(result)
@app.route("/movies", methods=['GET'])
def movie_record():
return nice_json(movies)
if __name__ == "__main__":
app.run(port=5001, debug=True)
from services import root_dir, nice_json
from flask import Flask
from werkzeug.exceptions import NotFound
import json
import os
app = Flask(__name__)
with open("{}/database/showtimes.json".format(os.getcwd()), "r") as f:
showtimes = json.load(f)
@app.route("/", methods=['GET'])
def hello():
return nice_json({
"uri": "/",
"subresource_uris": {
"showtimes": "/showtimes",
"showtime": "/showtimes/<date>"
}
})
@app.route("/showtimes", methods=['GET'])
def showtimes_list():
nice_json(showtimes)
@app.route("/showtimes/<date>", methods=['GET'])
def showtimes_record(date):
if date not in showtimes:
raise NotFound
print(showtimes[date])
return nice_json(showtimes[date])
if __name__ == "__main__":
app.run(port=5002, debug=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment