<commit_before># ConfigServer

The simplest way to store YAML configuration and server it over HTTP

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'config_server'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install config_server

## Usage
To run the server you must have a configuration file first:
```yaml
#config.yml

production:
  api:
    db_host: prod.mydb.com
    s3_bucket: some-bucket-prod
  nginx:
    server_name: www.me.prod

staging:
  api:
    db_host: staging.mydb.com
    s3_bucket: some-bucket-staging
  nginx:
    server_name: www.me.staging
```
Then create the following ruby file:
```ruby
#my_configuration_server.rb

require 'config_server'

ConfigServer.start("config.yml")
```

and run `bundle exec ruby my_configuration_server.rb`

You can now query the server:



## Development<commit_msg>more readme<commit_after># ConfigServer

The simplest way to store YAML configuration and server it over HTTP

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'config_server'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install config_server

## Usage
To run the server you must have a configuration file first:
```yaml
#config.yml

production:
  api:
    db_host: prod.mydb.com
    s3_bucket: some-bucket-prod
  nginx:
    server_name: www.me.prod

staging:
  api:
    db_host: staging.mydb.com
    s3_bucket: some-bucket-staging
  nginx:
    server_name: www.me.staging
```
Then create the following ruby file:
```ruby
#my_configuration_server.rb

require 'config_server'

ConfigServer.start("config.yml")
```

and run `bundle exec ruby my_configuration_server.rb`

You can now query the server:

1. In the first example we get the production db host for the api service
2. In the second example we ask for a non existing key and get a 404 response
3. In the third example we ask for a key which has a hash value. We get a JSON
   representation of it.

![Usage Examples]
(https://raw.githubusercontent.com/nanit/config-server/master/doc/usage.png)

## Development
{'fraction_non_alphanumeric': 0.08480228680323963, 'fraction_numerical': 0.004764173415912339, 'mean_word_length': 3.9065420560747666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6139125', 'n_tokens_mistral': 704, 'n_tokens_neox': 656, 'n_words': 243}