Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 4befe32

Browse files
committed
Merge pull request #63 from VictorBjelkholm/fix-node-window
Correctly detect browser vs node environment
2 parents 9747490 + 041f1c5 commit 4befe32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function IpfsAPI (host_or_multiaddr, port) {
2222

2323
// autoconfigure in browser
2424
if (!config.host &&
25-
window && window.location) {
25+
typeof window !== 'undefined') {
2626
var split = window.location.host.split(':')
2727
config.host = split[0]
2828
config.port = split[1]

0 commit comments

Comments
 (0)