Skip to content

Commit

Permalink
Updated Getting started instructions (#194)
Browse files Browse the repository at this point in the history
Fix #193 

Co-authored-by: Alex <[email protected]>
  • Loading branch information
AmbersG and Alex authored Mar 19, 2024
1 parent ae11e44 commit f869165
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,30 @@ There are three primary goals of this repo:

The recommended way to get started is to browse the [website](https://natsbyexample.com) which provides nicer navigation and presentation for the example code in this repo.

When you want to actually execute the example code, you can clone this repo, download the [`nbe`](https://github.com/ConnectEverything/nats-by-example/releases) CLI and use the `run` command at the root of the repo. For example:
When you want to actually execute the example code, you need to:

**Pre-requisite requirement:** currently the nbe CLI needs [Docker](https://docs.docker.com/) and [Compose](https://docs.docker.com/compose/) (v2+) to work. It runs a set of containers hosting the CLI client and the NATS server. Other container runtimes would be considered if requested (such as [Podman](https://podman.io/)).
Install [Docker](https://docs.docker.com/) and [Compose](https://docs.docker.com/compose/) (if you do not have them installed).

1. Clone this repository.
2. Download the [nbe](https://github.com/ConnectEverything/nats-by-example/releases) CLI and extract the binary to the root of the cloned repository.
3. Run the command with an example you want to try at the root of the repo:
```sh
$ nbe run messaging/pub-sub/cli
```

This will run the NATS CLI implementation of the [core publish-subscribe example](https://natsbyexample.com/examples/messaging/pub-sub/cli/) in a set of containers.

Currently, the `nbe` CLI depends on [Docker](https://docs.docker.com) and [Compose](https://docs.docker.com/compose/) (v2+) to run a set of containers hosting the CLI client and the NATS server. Other container runtimes would be considered if requested (such as [Podman](https://podman.io)).
If everything is ok, you will see this output in console (timestamp will be different):
```sh
09:17:59 Published 5 bytes to "greet.joe"
09:17:59 Subscribing on greet.*
09:18:00 Published 5 bytes to "greet.joe"

[1] Received on "greet.joe"
hello

[2] Received on "greet.pam"
```
The name of the example corresponds to the directory structure under `examples/`, specifically `<category>/<example>/<client>`.

Have questions, issues, or suggestions? Please open [start a discussion](https://github.com/ConnectEverything/nats-by-example/discussions) or open [an issue](https://github.com/ConnectEverything/nats-by-example/issues).
Expand Down

1 comment on commit f869165

@github-actions
Copy link

@github-actions github-actions bot commented on f869165 Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for nats-by-example ready!

✅ Preview
https://nats-by-example-fy57vmpqd-connecteverything.vercel.app

Built with commit f869165.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.