rangle/koast — pull request #30 by e-schultz (2014-09-29 21:09:13+00:00)
Title: Configuration connundrum

change configuration loading to use shortstop & improve environment based loading.

- default/common configuration is located in config/app.json
- environment based configuration are located in config/environment.json
- koast now has a set of defaults that calling applications can use by default,
and override in he app.json, or environment.json as needed

example:

- if no app.json is used, koast will launch the server on port 3001
- if app.json is used, with { app: { port : "3002" } }, server will launch on 3002
- if staging.json is used, with { app: { port: "3003" } }, when the environment
is set to staging, port 3003 will be used.

BREAKING CHANGE:

- app.json - now expects application settings to be under the configuration key 'app'

before:
```
{
port: 3000
}
```
after:
```
{
app:
{
port: 3000
}
}
```

- config.setEnviroment now returns a promise

before:

```
var koast = require('koast');
koast.config.setEnvironment();
koast.serve();
```
after:
```
var koast = require('koast');
koast.config
.setEnvironment()
.then(koast.serve);
```