diff options
Diffstat (limited to 'internal/handler/handler.go')
-rw-r--r-- | internal/handler/handler.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 11c1936..bd8a2c1 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -4,14 +4,10 @@ import ( "net/http" "strings" - "go.neonxp.dev/json" - jsonModel "go.neonxp.dev/json/model" - "go.neonxp.dev/djson/internal/events" - "go.neonxp.dev/djson/internal/tree" ) -func New(core tree.Core, eventsDispatcher events.Dispatcher) Handler { +func New(core Core, eventsDispatcher events.Dispatcher) *handler { return &handler{ core: core, events: eventsDispatcher, @@ -19,13 +15,12 @@ func New(core tree.Core, eventsDispatcher events.Dispatcher) Handler { } type handler struct { - core tree.Core + core Core events events.Dispatcher } func writeError(code int, err error, w http.ResponseWriter) { - jsonErr, _ := json.Marshal(jsonModel.NewNode(err.Error())) - _, _ = w.Write(jsonErr) + _, _ = w.Write([]byte(err.Error())) } func parsePath(nodePath string) []string { |