mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-30 15:28:42 +01:00
fixed dep verisons for uuid. finished passing env around
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
package tuu
|
||||
|
||||
import (
|
||||
"github.com/gorilla/mux"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
gcontext "github.com/gorilla/context"
|
||||
)
|
||||
|
||||
type Route struct {
|
||||
Method string
|
||||
Path string
|
||||
Handler Handler
|
||||
Method string
|
||||
Path string
|
||||
Handler Handler
|
||||
MuxHandler mux.Route
|
||||
Env string
|
||||
}
|
||||
|
||||
func (r *Route) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||
defer gcontext.Clear(req)
|
||||
|
||||
c := NewContext(*r, res, req)
|
||||
c := NewContext(*r, res, req, r.Env)
|
||||
|
||||
if err := r.Handler(c); err != nil {
|
||||
c.Response().WriteHeader(500)
|
||||
|
||||
Reference in New Issue
Block a user