Skip to content

Commit

Permalink
fix path miss in windows/add a new api create function (#23)
Browse files Browse the repository at this point in the history
* fix path was not always correct in windows

* add new api create function for if the port was different with api file.

* Update api.go

remove no need commit


This commit was moved from ipfs/go-ipfs-http-client@8c87deb
  • Loading branch information
godcong authored and Stebalien committed Aug 12, 2019
1 parent 9345cfa commit be8f802
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/httpapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"net/http"
gohttp "net/http"
"os"
"path"
"path/filepath"
"strings"

iface "github.com/ipfs/interface-go-ipfs-core"
caopts "github.com/ipfs/interface-go-ipfs-core/options"
homedir "github.com/mitchellh/go-homedir"
"github.com/mitchellh/go-homedir"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr-net"
)
Expand Down Expand Up @@ -73,7 +73,7 @@ func ApiAddr(ipfspath string) (ma.Multiaddr, error) {
return nil, err
}

apiFile := path.Join(baseDir, DefaultApiFile)
apiFile := filepath.Join(baseDir, DefaultApiFile)

api, err := ioutil.ReadFile(apiFile)
if err != nil {
Expand Down

0 comments on commit be8f802

Please sign in to comment.