Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readmes to examples #83

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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