Skip to content

Commit

Permalink
Adds README files for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-k committed Nov 29, 2023
1 parent 4bf8304 commit d2a8585
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/mig-example-apps/Counter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Counter

An example on how to use Reader-pattern with the `mig` library.
4 changes: 4 additions & 0 deletions examples/mig-example-apps/CounterClient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CounterClient

An example on how to build client and server from the same code

3 changes: 3 additions & 0 deletions examples/mig-example-apps/HelloClient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello world server and client

An example on how to build server and client from the same code.
29 changes: 29 additions & 0 deletions examples/mig-example-apps/HelloWorld/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Hello wrold server

An example of the most basic JSON API server
that has two routes. It can greet the user and say good bye.

We can use `curl` to test it.
Run it with:

```
> stack run hello-world-mig-example-app
```

After server start we can test it with [Swagger UI](http://localhost:8085/swagger-ui/index.html).
Or with curl:

Curl for hello route
```
curl -X 'GET' \
'http://localhost:8085/api/v1/hello' \
-H 'accept: application/json'
```

Curl for bye route

```
curl -X 'GET' \
'http://localhost:8085/api/v1/bye?user=alice' \
-H 'accept: application/json'
```
9 changes: 9 additions & 0 deletions examples/mig-example-apps/Html/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Html

A simple blog post site that servers HTML.
To run use:

```
> stack run html-mig-example-app
```
9 changes: 9 additions & 0 deletions examples/mig-example-apps/HtmlTemplate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# HtmlTemplate

A variation of `Html` example with safe URLs and HTML-templates based on mustache.

To run use:

```
> stack run html-template-mig-example-app
```
9 changes: 9 additions & 0 deletions examples/mig-example-apps/JsonApi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# JsonApi

A weather forecast JSON API example. It shows how to build JSON API servers.

To run use:

```
> stack run json-api-mig-example-app
```
Empty file.
4 changes: 4 additions & 0 deletions examples/mig-example-apps/RouteArgsClient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RouteArgsClient

Client with all sorts of inputs

0 comments on commit d2a8585

Please sign in to comment.