Skip to content

Commit

Permalink
Styling fixes for create-rest-api.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vtquan authored Dec 30, 2024
1 parent a4f7353 commit eb6b9aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/content/tutorials/create-rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ let apiRouter =
}
```

This will be the base of our Books API endpoints at "http://localhost:8085/api/books/".
This will be the base of our Books API endpoints at `"http://localhost:8085/api/books/"`.

This router will automatically pass `HttpFunc and `HttpContext to our action functions as parameters. Now, let's create our action functions.
This router will automatically pass `HttpFunc` and `HttpContext` to our action functions as parameters. Now, let's create our action functions.

We don't need an id to return a list of all books so the path for our GET request is `"http://localhost:8085/api/books/"` thanks to `forward "/books" Books.Controller.apiRouter` inside our Router.fs file.

Expand All @@ -43,7 +43,7 @@ For POST, we need to parse the object passed in with the request. Generally, thi

For PUT, we need both the id and the object so we will have both `putf` and `bindJson` to get the values to pass to `putAction`.

The id is needed for DELETE so we use `deletef`.
For DELETE, the id is needed so we use `deletef`.

| Format String | Type |
| ----------- | ---- |
Expand Down

0 comments on commit eb6b9aa

Please sign in to comment.