Skip to content
Snippets Groups Projects
Commit 5f8b89d9 authored by Khalid, Rizwan (UG - Computer Science)'s avatar Khalid, Rizwan (UG - Computer Science)
Browse files

Replaced nice_json with json.dumps

parent 1bc108e6
No related branches found
No related tags found
No related merge requests found
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__":
......
from services import root_dir, nice_json
from flask import Flask
from werkzeug.exceptions import NotFound
import json
......@@ -13,7 +12,7 @@ with open("{}/database/showtimes.json".format(os.getcwd()), "r") as f:
@app.route("/", methods=['GET'])
def hello():
return nice_json({
return json.dumps({
"uri": "/",
"subresource_uris": {
"showtimes": "/showtimes",
......@@ -32,7 +31,7 @@ def showtimes_record(date):
if date not in showtimes:
raise NotFound
print(showtimes[date])
return nice_json(showtimes[date])
return json.dumps(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