API extension points (#473)

* API endpoint extensions working.

extensions example.

* Added server.NewEnv and some docs for the API extensions example.

extensions example.
example main.go.

* Uncommented special handler stuff.

* Added section in docs for extending API linking to example main.go.

* Commented out special_handler test

* Changed to NewFromEnv
This commit is contained in:
Travis Reeder
2017-01-30 12:14:28 -08:00
committed by GitHub
parent dd052d4503
commit d5116397b6
16 changed files with 256 additions and 108 deletions

View File

@@ -13,7 +13,7 @@ import (
func New(dbURL string) (models.Datastore, error) {
u, err := url.Parse(dbURL)
if err != nil {
logrus.WithFields(logrus.Fields{"url": dbURL}).Fatal("bad DB URL")
logrus.WithError(err).WithFields(logrus.Fields{"url": dbURL}).Fatal("bad DB URL")
}
logrus.WithFields(logrus.Fields{"db": u.Scheme}).Debug("creating new datastore")
switch u.Scheme {