From 9b25a75a3634b0724b9373a5e58a24c321eced6d Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 4 Nov 2016 11:24:46 +0000 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20pass=20in=20surreal=20conf=20op?= =?UTF-8?q?tions=20to=20fibre=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- glide.lock | 4 ++-- web/conf.go | 1 + web/web.go | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glide.lock b/glide.lock index 11d644b7..af3bf3cf 100644 --- a/glide.lock +++ b/glide.lock @@ -1,10 +1,10 @@ hash: 0402d462f75cf177f62e8a0c786da7e9ca6a22535e6412965b600141842d6dae -updated: 2016-10-29T14:57:11.583277704+01:00 +updated: 2016-11-04T11:11:57.580487578Z imports: - name: github.com/abcum/cork version: 2d785aed8e7cc57a3b6741042a9b421a9d81fc13 - name: github.com/abcum/fibre - version: cb521c4d2cdc231c3efa08aef9cc7c731741c2a8 + version: bc5ac776be0fd0e64d9546099a9f14e91652b600 subpackages: - mw - name: github.com/abcum/logrus diff --git a/web/conf.go b/web/conf.go index cf6d5204..1e01d89e 100644 --- a/web/conf.go +++ b/web/conf.go @@ -23,6 +23,7 @@ func conf() fibre.MiddlewareFunc { return func(h fibre.HandlerFunc) fibre.HandlerFunc { return func(c *fibre.Context) error { + c.Set("KV", cnf.Settings.DB.Base) return h(c) diff --git a/web/web.go b/web/web.go index 7f76bf8b..a333228e 100644 --- a/web/web.go +++ b/web/web.go @@ -26,7 +26,7 @@ func Setup(opts *cnf.Options) (err error) { log.WithPrefix("web").Infof("Starting web server on %s", opts.Conn.Web) - s := fibre.Server(opts) + s := fibre.Server() routes(s) s.SetWait("15s") @@ -36,7 +36,6 @@ func Setup(opts *cnf.Options) (err error) { // Setup middleware - s.Use(conf()) // Setup conf s.Use(auth()) // Setup auth s.Use(mw.Logs()) // Log requests s.Use(mw.Fail()) // Catch panics