mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 17:36:38 +08:00
implemented suggestions by whyrusleeping
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
|||||||
"github.com/gonuts/flag"
|
"github.com/gonuts/flag"
|
||||||
"github.com/jbenet/commander"
|
"github.com/jbenet/commander"
|
||||||
h "github.com/jbenet/go-ipfs/http"
|
h "github.com/jbenet/go-ipfs/http"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdIpfsServe = &commander.Command{
|
var cmdIpfsServe = &commander.Command{
|
||||||
@ -18,7 +17,7 @@ var cmdIpfsServe = &commander.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmdIpfsServe.Flag.Uint("port", 80, "Port number")
|
cmdIpfsServe.Flag.Uint("port", 8080, "Port number")
|
||||||
cmdIpfsServe.Flag.String("hostname", "localhost", "Hostname")
|
cmdIpfsServe.Flag.String("hostname", "localhost", "Hostname")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ func serveCmd(c *commander.Command, _ []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
address := hostname + ":" + strconv.FormatUint(uint64(port), 10)
|
address := fmt.Sprintf("%s:%d", hostname, port)
|
||||||
fmt.Printf("Serving on %s\n", address)
|
fmt.Printf("Serving on %s\n", address)
|
||||||
|
|
||||||
return h.Serve(address, n)
|
return h.Serve(address, n)
|
||||||
|
Reference in New Issue
Block a user