1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 19:24:14 +08:00

Merge pull request #3723 from ipfs/fix/daemon/late-gw

daemon: move gateway start to latter
This commit is contained in:
Jeromy Johnson
2017-03-01 16:45:14 -08:00
committed by GitHub

View File

@ -377,17 +377,6 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
return
}
// construct http gateway - if it is set in the config
var gwErrc <-chan error
if len(cfg.Addresses.Gateway) > 0 {
var err error
err, gwErrc = serveHTTPGateway(req)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
}
// construct fuse mountpoints - if the user provided the --mount flag
mount, _, err := req.Option(mountKwd).Bool()
if err != nil {
@ -413,6 +402,17 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
return
}
// construct http gateway - if it is set in the config
var gwErrc <-chan error
if len(cfg.Addresses.Gateway) > 0 {
var err error
err, gwErrc = serveHTTPGateway(req)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
}
// initialize metrics collector
prometheus.MustRegister(&corehttp.IpfsNodeCollector{Node: node})