Skip to content

Commit

Permalink
docs: usage
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Aug 16, 2024
1 parent 8bd26c0 commit dfe2d7e
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,52 @@ A simple report-to-Slack reporter for [Tower](https://github.com/mimiquate/tower

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `tower_slack` to your list of dependencies in `mix.exs`:
The package can be installed by adding `tower_slack` to your list of dependencies in `mix.exs`:

```elixir
# mix.exs

def deps do
[
{:tower_slack, "~> 0.1.0"}
]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/tower_slack>.
## Usage

```elixir
# config/config.exs

config(
:tower,
:reporters,
[
# along any other possible reporters
TowerRollbar.Reporter
]
)
```

```elixir
# config/runtime.exs

config :tower_rollbar,
enabled: config_env() == :prod,
access_token: System.get_env("ROLLBAR_SERVER_ACCESS_TOKEN"),
environment: System.get_env("DEPLOYMENT_ENV", to_string(config_env()))
```

```elixir
# lib/<your_app>/application.ex

defmodule YourApp.Application do
def start(_type, _args) do
Tower.attach()

# rest of your code
end
```

## License

Expand Down

0 comments on commit dfe2d7e

Please sign in to comment.