Skip to content

Commit

Permalink
Merge pull request #83 from anton-k/add-readmes-to-examples
Browse files Browse the repository at this point in the history
Add readmes to examples
  • Loading branch information
anton-k authored Nov 29, 2023
2 parents 4bf8304 + e80f550 commit 0036e40
Show file tree
Hide file tree
Showing 9 changed files with 75 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
```
After server start we can try it out in the browser. Go to [the main page](http://localhost:8085).
11 changes: 11 additions & 0 deletions examples/mig-example-apps/HtmlTemplate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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
```

After server start we can try it out in the browser. Go to [the main page](http://localhost:8085).
12 changes: 12 additions & 0 deletions examples/mig-example-apps/JsonApi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
```

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

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 0036e40

Please sign in to comment.