Skip to content

Commit

Permalink
Merge pull request #12 from Comcast/feature/support_request_context
Browse files Browse the repository at this point in the history
Use the Alice decorator to suck in the device name
  • Loading branch information
johnabass committed Aug 4, 2017
2 parents 3b5cf93 + ec83f44 commit 4f732f6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/talaria/primaryHandler.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
"net/http"

"github.com/Comcast/webpa-common/device"
"github.com/Comcast/webpa-common/logging"
"github.com/Comcast/webpa-common/wrp"
"github.com/gorilla/mux"
"github.com/spf13/viper"
"net/http"
)

const (
Expand Down Expand Up @@ -48,10 +49,13 @@ func NewPrimaryHandler(logger logging.Logger, connectedUpdates <-chan []byte, ma
apiHandler.Handle("/devices", listHandler).
Methods("GET")

apiHandler.Handle("/device", &device.ConnectHandler{
Logger: logger,
Connector: manager,
})
apiHandler.Handle(
"/device",
device.UseID.FromHeader(&device.ConnectHandler{
Logger: logger,
Connector: manager,
}),
)

return handler, nil
}

0 comments on commit 4f732f6

Please sign in to comment.