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

doc: added instructions to run example #25

Merged
merged 3 commits into from
Jun 23, 2024
Merged
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ Notice from the above that the migration struct name follows a particular struct

This library doesn't support multiple transformations per version as of the time of this writing. For example, no handler can have multiple changes for the same version.

## Example
Check the [example](./example) directory for a full example. Do the following to run the example:

1. Run the server.
```bash
$ git clone https://github.com/subomi/requestmigrations

$ cd example/basic

$ go run *.go
```

2. Open another terminal and call the server
```bash
# Call the API without specifying a version.
$ curl -s localhost:9000/users \
-H "Content-Type: application/json" | jq

# Call the API with 2023-04-01 version.
$ curl -s localhost:9000/users \
-H "Content-Type: application/json" \
-H "X-Example-Version: 2023-04-01" | jq
```

## License
MIT License
Loading