commands/http: Made Handler set request contexts

This commit is contained in:
Matt Bell 2014-10-27 18:14:24 -07:00 committed by Juan Batiz-Benet
parent 3f4da97c58
commit 0b73a48b84

View File

@ -20,6 +20,8 @@ var Daemon = &cmds.Command{
}
func daemonFunc(req cmds.Request, res cmds.Response) {
// TODO: spin up a core.IpfsNode
ctx := req.Context()
lk, err := daemon.Lock(ctx.ConfigRoot)
@ -41,7 +43,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
return
}
handler := cmdsHttp.Handler{}
handler := cmdsHttp.Handler{*ctx}
http.Handle(cmdsHttp.ApiPath+"/", handler)
err = http.ListenAndServe(host, nil)
if err != nil {