Skip to content
Snippets Groups Projects
Commit cdf4b526 authored by Sastry, Nishanth Prof (Comp Sci & Elec Eng)'s avatar Sastry, Nishanth Prof (Comp Sci & Elec Eng)
Browse files

Merge branch 'master' into 'simpleservices'

# Conflicts:
#   README.md
parents ff35c82e 1bc108e6
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,11 @@ python3 movies.py
```
Now, the movies microservice is running. You can query it by sending HTTP GET requests. Note that we are using the port 5001 on localhost (127.0.0.1) as that is how the server is configured (see towards the bottom of the file in movies.py)
```
```console
python3 movies.py
```
Now, the movies microservice is running. You can query it by sending HTTP GET requests. Note that we are using the port 5001 on localhost (127.0.0.1) as that is how the server is configured (see towards the bottom of the file in movies.py)
```console
curl http://127.0.0.1:5001/ #returns list of endpoints exposed
curl http://127.0.0.1:5001/movies #returns list of all movies
curl http://127.0.0.1:5001/movies/720d006c-3a57-4b6a-b18f-9b713b073f3c #returns details of one movie
......@@ -21,6 +26,11 @@ python3 showtimes.py
```
You can query its endpoints too:
```
```console
python3 showtimes.py
```
You can query its endpoints too:
```console
$ curl 127.0.0.1:5002/
{"uri": "/", "subresource_uris": {"showtimes": "/showtimes", "showtime": "/showtimes/<date>"}}%
$ curl 127.0.0.1:5002/showtimes
......@@ -31,6 +41,7 @@ $ curl 127.0.0.1:5002/showtimes
As with the movies, the showtimes microservice allows you to query one single record. For a date that it knows about (e.g., 30 Nov 2015 or `20151130`), you can ask what movies were shown on that date.
```
```console
$ curl 127.0.0.1:5002/showtimes/20151130
[
"720d006c-3a57-4b6a-b18f-9b713b073f3c",
......@@ -40,6 +51,7 @@ $ curl 127.0.0.1:5002/showtimes/20151130
```
You get back a list of movie *IDs*. This is nice, but not wholly satisfactory. Your next task is to modify the `showtimes_record` function to contact the movies microservice to get the movie title given its ID, and make the showtimes service return back a more user-friendly response that looks like this:
```
```console
$ curl 127.0.0.1:5002/showtimes/20151130
[
"The Good Dinosaur",
......@@ -47,7 +59,6 @@ $ curl 127.0.0.1:5002/showtimes/20151130
"Spectre"
]%
```
Try your best to solve it. If you need hints, you will find the solution for this in the branch `simpleservices`, which you can obtain by running `git checkout simpleservices`. Note that after checking out this branch, you will have to start both the `movies` and `showtimes` microservices and then issue the curl request. The showtimes microservice will talk to movies microservice to deliver the final result.
The main change needed is simple. We just have to issue an HTTP GET request to the movies API endpoint. We do this by changing `showtime_record` as follows:
```python
......
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