Skip to content
Snippets Groups Projects
Commit f6dc60ec authored by Ubuntu's avatar Ubuntu
Browse files

Lab

parent fd5e32b3
No related branches found
No related tags found
No related merge requests found
.venv
get-pip.py
services/__pycache__
......@@ -3,7 +3,7 @@ from flask import Flask
from werkzeug.exceptions import NotFound
import json
import os
import requests
app = Flask(__name__)
......@@ -27,12 +27,17 @@ def showtimes_list():
return nice_json(showtimes)
movies_service = "http://127.0.0.1:5001/movies/{}"
@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])
result = []
for movie_id in showtimes[date]:
resp = requests.get(movies_service.format(movie_id))
result.append(resp.json()["title"])
return nice_json(result)
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