Skip to content

Commit

Permalink
added a more detailed explanation of what happens with ips and docker…
Browse files Browse the repository at this point in the history
… in building the gateway application / get device
  • Loading branch information
sofiiako committed Jul 15, 2024
1 parent 6f8d725 commit 74b3d91
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Building the Gateway Application/Get Devices/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ import requests
data = ... # from request
response = requests.get("http://0.0.0.0:5000/items/")
```
Let's keep it that way for this task, but let's also keep in mind that
This would be totally okay if you wanted to deploy your applications locally (without Docker), however,
by doing this, our application source code becomes coupled with how and where we deploy `invsys`.
Instead, we can post to `http://invsys:5000/items` and ensure that our network is set up to route `invsys` to whichever IP it is hosted on.
We will come back to this later on.
You can use `0.0.0.0` for local deployment if you like, but for checking this task, we ask
you to replace it with `invsys`, so that your url looks something like this:
`http://invsys:5000/items` (check out the url in the `else` clause which is already completed).
We will explain this in more detail in the next lesson, for now you only need to know that
we use Docker under the hood to check these tasks, so `invsys` will be a designated name of a docker-compose service and
Docker will take care of names and routing.

<div class="hint">

To create the right url for getting a specific item you only need to slightly modify the get url that is already provided - add the `item_id` to it.
</div>

0 comments on commit 74b3d91

Please sign in to comment.