Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
feat: add alias and more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed Feb 1, 2022
1 parent 5e024f2 commit eafd5eb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .cligen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "Dummy"
commands:
- name: "server"
alias: "s"
description: "run mock server"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ go install github.com/go-dummy/dummy/cmd/dummy@latest
## Usage
Dummy can help you run mock server based off an API contract, which helps people see how your API will work before you even have it built. Run it locally with the `dummy server` command to run your API on a HTTP server you can interact with.
```shell
dummy server ./openapi.yml
dummy s openapi.yml
```
```shell
dummy server https://raw.githubusercontent.com/go-dummy/dummy/main/examples/docker/openapi3.yml
dummy s https://raw.githubusercontent.com/go-dummy/dummy/main/examples/docker/openapi.yml
```
More usage [examples](examples)

Expand Down
1 change: 1 addition & 0 deletions cmd/dummy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func run() error {
cmds := []acmd.Command{
{
Name: "server",
Alias: "s",
Description: "run mock server",
Do: func(ctx context.Context, args []string) error {
cfg := config.NewConfig()
Expand Down
13 changes: 13 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Usage
```shell
dummy s openapi.yml
```
```shell
dummy server openapi.yml
```
```shell
dummy s openapi.json
```
```shell
dummy s https://raw.githubusercontent.com/go-dummy/dummy/main/examples/docker/openapi.yml
```
2 changes: 1 addition & 1 deletion examples/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY ./openapi3.yml .

WORKDIR .

CMD ["dummy", "server", "openapi3.yml", "-port=8080"]
CMD ["dummy", "s", "openapi.yml", "-port=8080"]
File renamed without changes.

0 comments on commit eafd5eb

Please sign in to comment.