diff --git a/movies.py b/movies.py index 9f6a2e23752f1843267d1f59f81abc51f831df1c..0b6f76ee85f35e930a18932a688198b5533e973e 100644 --- a/movies.py +++ b/movies.py @@ -1,4 +1,3 @@ -from services import root_dir, nice_json from flask import Flask from werkzeug.exceptions import NotFound import json @@ -11,7 +10,7 @@ with open("{}/database/movies.json".format(os.getcwd()), "r") as f: @app.route("/", methods=['GET']) def hello(): - return nice_json({ + return json.dumps({ "uri": "/", "subresource_uris": { "movies": "/movies", @@ -27,12 +26,12 @@ def movie_info(movieid): result = movies[movieid] result["uri"] = "/movies/{}".format(movieid) - return nice_json(result) + return json.dumps(result) @app.route("/movies", methods=['GET']) def movie_record(): - return nice_json(movies) + return json.dumps(movies) if __name__ == "__main__": diff --git a/showtimes.py b/showtimes.py index c0c2a53628ae29315afb10400646228b1943931c..1d00c967dac56302a9305ada716cfdb3f0778c3d 100644 --- a/showtimes.py +++ b/showtimes.py @@ -1,4 +1,3 @@ -from services import root_dir, nice_json from flask import Flask from werkzeug.exceptions import NotFound import json @@ -16,7 +15,7 @@ with open(showtimes_db, "r") as f: @app.route("/", methods=['GET']) def hello(): - return nice_json({ + return json.dumps({ "uri": "/", "subresource_uris": { "showtimes": "/showtimes", @@ -27,7 +26,7 @@ def hello(): @app.route("/showtimes", methods=['GET']) def showtimes_list(): - nice_json(showtimes) + return json.dumps(showtimes) @app.route("/showtimes/<date>", methods=['GET']) @@ -39,7 +38,7 @@ def showtimes_record(date): for movie_id in showtimes[date]: resp = requests.get(movies_service.format(movie_id)) result.append(resp.json()["title"]) - return nice_json(result) + return json.dumps(result) if __name__ == "__main__": app.run(port=5002, debug=True)