Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • F FastAPI
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Sitemule
  • Public
  • workshops
  • open source on IBM i
  • FastAPI
  • Wiki
  • Part 1b. Testing my first service

Part 1b. Testing my first service · Changes

Page history
Update Part 1b. Testing my first service authored Oct 29, 2021 by Jens Melgard Churchill's avatar Jens Melgard Churchill
Hide whitespace changes
Inline Side-by-side
Part-1b.-Testing-my-first-service.md
View page @ 984ddb07
......@@ -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
Clone repository
  • Part 1a. My first service
  • Part 1b. Testing my first service
  • Part 2a. Extending my first service
  • Part 2b. Organise my first service
  • Part 3a. Review my first service
  • Part 3b. Connecting my first service
  • Home