Skip to content

remove code type in samples = proper code formatting? #257

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

Merged
merged 4 commits into from
Jul 17, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ For details on the notification types, what causes them to be triggered, and the
## Configuration

By default, the notifications endpoint is disabled. To enable it, change config.yaml:
```yaml

```
# config.yaml
api:
enableNotifications: true
```

Or, enable it by setting an environment variable:

```shell script
```
# set an env. variable
export OPTIMIZELY_API_ENABLENOTIFICATIONS=1
```

## Usage

Send a `GET` request to `/v1/notifications/event-stream` to subscribe:

```shell script
```
curl -N -H "Accept:text/event-stream" -H "X-Optimizely-Sdk-Key:<YOUR SDK KEY>"\
http://localhost:8080/v1/notifications/event-stream
```
Expand All @@ -44,7 +46,8 @@ This connection will remain open, and any notifications triggered by other reque

To subscribe only to a particular category of notifications, add a `filter` query parameter. For example, to subscribe only to Decision notifications:

```shell script
```
# filter on decision notifications
curl -N -H "Accept:text/event-stream" -H "X-Optimizely-Sdk-Key:<YOUR SDK KEY>"\
http://localhost:8080/v1/notifications/event-stream?filter=decision
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Internally, Optimizely Agent uses the [Viper](https://github.com/spf13/viper) li

The default location of the config file is `config.yaml` in the root directory. If you want to specify another location, use the `OPTIMIZELY_CONFIG_FILENAME` environment variable:

```bash
```
OPTIMIZELY_CONFIG_FILENAME=/path/to/other_config_file.yaml make run
```

Expand All @@ -34,16 +34,16 @@ When setting the value of "nested" configuration options using environment varia

Set the polling interval in YAML:

```yaml
```
# Setting a nested value in a .yaml file:
client:
pollingInterval: 120s
```

Set the polling interval with a shell script:

```shell script
// Set environment variable for pollingInterval, nested inside client
```
# Set environment variable for pollingInterval, nested inside client
export OPTIMIZELY_CLIENT_POLLINGINTERVAL=120s
```

Expand Down