mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-03 15:27:57 +08:00
commands/http: Made Handler set request contexts
This commit is contained in:
parent
3f4da97c58
commit
0b73a48b84
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user