... | ... | @@ -37,7 +37,7 @@ Awesome, we have life! - Let's test some more, remember the other endpoint?... |
|
|
|
|
|
`curl -sS localhost:${HTTP_PORT:-9000}/items | jq .`
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
{
|
|
|
"detail": "Not Found"
|
|
|
}
|
... | ... | @@ -49,7 +49,7 @@ FastAPI will enforce that! - let's try again... |
|
|
|
|
|
`curl -sS localhost:${HTTP_PORT:-9000}/items/id-1 | jq .`
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
{
|
|
|
"detail": [
|
|
|
{
|
... | ... | @@ -71,7 +71,7 @@ Let's get a proper result, this time adding the **optional** query-string argume |
|
|
|
|
|
`curl -sS localhost:${HTTP_PORT:-9000}/items/1?q=abc | jq .`
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
{
|
|
|
"item_id": 1,
|
|
|
"q": "abc"
|
... | ... | @@ -82,13 +82,23 @@ Cool, but aren't we leaving |
|
|
|
|
|
Knowing that we can test from the shell is nice, and very useful for automation, but lets head over to the browser shall we?
|
|
|
|
|
|
Click [your.ibmi.rocks](https://your.ibmi.rocks/) and enter your user id, the resulting URI is the one we'll work with from here on out.
|
|
|
Goto [**fastapi.ibmi.rocks**](https://fastapi.ibmi.rocks/) and enter your user id, the resulting URI is the one you'll work with from here on out.
|
|
|
|
|
|
![image](uploads/65fff57dcc577c719db656dc82b781d1/image.png)
|
|
|
|
|
|
If your using a Chromium or Firefox based browser, I highly recommend installing the "JSON formatter" extension.
|
|
|
|
|
|
For [Chromium](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa) (Google Chrome, MS Edge, Opera) - For [Firefox](https://addons.mozilla.org/en-US/firefox/addon/json-formatter/)
|
|
|
|
|
|
## Well done!
|
|
|
|
|
|
Lets end the service by bringing it to the foreground, and stopping it.
|
|
|
|
|
|
To bring the process back to the foreground run `fg`\
|
|
|
Now simply cancel it by pressing `Ctrl+c`
|
|
|
|
|
|
\-
|
|
|
|
|
|
Good stuff, time to actually build something!
|
|
|
|
|
|
[Graduate to part 2...](Part-2a.-Extending-my-first-service) |
|
|
\ No newline at end of file |