Created
January 19, 2019 15:07
-
-
Save rsarai/63e96dd85c7be1a845ff559a8ee1e51a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import falcon | |
FAKE_DB_MOVIE = [{ | |
"Title": "The Alienist", | |
"Year": "2018", | |
"Rated": "TV-MA", | |
"Released": "22 Jan 2018", | |
"Runtime": "60 min", | |
"Genre": "Drama, Mystery", | |
"Director": "N/A", | |
"Writer": "N/A", | |
"Actors": "Daniel Brühl, Luke Evans, Brian Geraghty, Robert Wisdom", | |
"Plot": "Newspaper illustrator John Moore meets with criminal psychologist (alienist) Dr. Laszlo Kreizler to investigate a serial killer in New York during the late 19th century.", | |
"Language": "English", | |
"Country": "USA", | |
"Awards": "2 nominations.", | |
"Poster": "https://m.media-amazon.com/images/M/MV5BMTAyMDg5NjYzNTZeQTJeQWpwZ15BbWU4MDA2MTczMjQz._V1_SX300.jpg", | |
"Ratings": [ | |
{ | |
"Source": "Internet Movie Database", | |
"Value": "7.8/10" | |
} | |
], | |
"Metascore": "N/A", | |
"imdbRating": "7.8", | |
"imdbVotes": "22,904", | |
"imdbID": "tt4604612", | |
"Type": "series", | |
"totalSeasons": "1", | |
"Response": "True" | |
}] | |
class Movie(object): | |
def on_get(self, req, resp): | |
doc = {'movie': FAKE_DB_MOVIE} | |
resp.body = json.dumps(doc, ensure_ascii=False) | |
resp.status = falcon.HTTP_200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment