@@ -82,6 +82,10 @@ var ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/5001')
8282
8383// or using options
8484var ipfs = ipfsAPI ({host: ' localhost' , port: ' 5001' , protocol: ' http' })
85+
86+ // or specifying a specific API path
87+ var ipfs = ipfsAPI ({host: ' 1.1.1.1' , port: ' 80' , ' api-path' : ' /ipfs/api/v0' })
88+
8589```
8690### Importing a sub-module and usage
8791``` javascript
@@ -193,7 +197,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
193197 - [` ipfs .dag .put (dagNode, options, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagput)
194198 - [` ipfs .dag .get (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagget)
195199 - [` ipfs .dag .tree (cid [, path, options], callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DAG.md#dagtree)
196-
200+
197201- [object](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md).
198202 - [` ipfs .object .new ([template][, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectnew)
199203 - [` ipfs .object .put (obj, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/OBJECT.md#objectput)
@@ -219,30 +223,30 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
219223 - ` ipfs .bootstrap .list `
220224 - ` ipfs .bootstrap .add `
221225 - ` ipfs .bootstrap .rm `
222-
226+
223227- [bitswap](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
224228 - ` ipfs .bitswap .wantlist ()`
225229 - ` ipfs .bitswap .stat ()`
226230 - ` ipfs .bitswap .unwant ()`
227-
231+
228232- [dht](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/)
229233 - [` ipfs .dht .findprovs ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#findprovs)
230234 - [` ipfs .dht .get ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#get)
231235 - [` ipfs .dht .put ()` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/DHT.md#put)
232-
236+
233237- [pubsub](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md)
234238 - [` ipfs .pubsub .subscribe (topic, options, handler, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubsubscribe)
235239 - [` ipfs .pubsub .unsubscribe (topic, handler)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubunsubscribe)
236240 - [` ipfs .pubsub .publish (topic, data, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpublish)
237241 - [` ipfs .pubsub .ls (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubls)
238242 - [` ipfs .pubsub .peers (topic, callback)` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/PUBSUB.md#pubsubpeers)
239-
243+
240244- [swarm](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md)
241245 - [` ipfs .swarm .addrs ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#addrs)
242246 - [` ipfs .swarm .connect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#connect)
243247 - [` ipfs .swarm .disconnect (addr, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#disconnect)
244248 - [` ipfs .swarm .peers ([opts] [, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/SWARM.md#peers)
245-
249+
246250- [name](https://github.com/ipfs/interface-ipfs-core/tree/master/API/name)
247251 - [` ipfs .name .publish (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#publish)
248252 - [` ipfs .name .resolve (addr, [options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/NAME.md#resolve)
@@ -257,17 +261,17 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
257261 - ` ipfs .pingReadableStream (id, [options])`
258262 - [` ipfs .dns (domain, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#dns)
259263 - [` ipfs .stop ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/MISCELLANEOUS.md#stop). Alias to ` ipfs .shutdown ` .
260-
264+
261265- [config](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md)
262266 - [` ipfs .config .get ([key, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configget)
263267 - [` ipfs .config .set (key, value, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configset)
264268 - [` ipfs .config .replace (config, [callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/CONFIG.md#configreplace)
265-
269+
266270- [stats](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md)
267271 - [` ipfs .stats .bitswap ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bitswap)
268272 - [` ipfs .stats .bw ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#bw)
269273 - [` ipfs .stats .repo ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/STATS.md#repo)
270-
274+
271275- log
272276 - ` ipfs .log .ls ([callback])`
273277 - ` ipfs .log .tail ([callback])`
@@ -277,7 +281,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
277281 - [` ipfs .repo .gc ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#gc)
278282 - [` ipfs .repo .stat ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#stat)
279283 - [` ipfs .repo .version ([callback])` ](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#version)
280-
284+
281285- [key](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md)
282286 - [` ipfs .key .gen (name, options, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeygenname-options-callback)
283287 - [` ipfs .key .list ([options, callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeylistcallback)
@@ -286,7 +290,7 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P
286290 - [` ipfs .key .export (name, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyexportname-password-callback)
287291 - [` ipfs .key .import (name, pem, password, [callback])` ](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/KEY.md#javascript---ipfskeyimportname-pem-password-callback)
288292
289- #### ` Pubsub Caveat`
293+ #### ` Pubsub Caveat`
290294
291295**Currently, the [PubSub API only works in Node.js envinroment](https://github.com/ipfs/js-ipfs-api/issues/518)**
292296
@@ -335,7 +339,7 @@ Complete documentation for these methods is coming with: https://github.com/ipfs
335339Reads a file or folder from ` path` on the filesystem and adds it to IPFS. Options:
336340- **recursive**: If ` path` is a directory, use option ` { recursive: true }` to add the directory and all its sub-directories.
337341 - **ignore**: To exclude fileglobs from the directory, use option ` { ignore: [' ignore/this/folder/**' , ' and/this/file' ] }` .
338- - **hidden**: hidden/dot files (files or folders starting with a ` .` , for example, ` .git / ` ) are not included by default. To add them, use the option ` { hidden: true }` .
342+ - **hidden**: hidden/dot files (files or folders starting with a ` .` , for example, ` .git / ` ) are not included by default. To add them, use the option ` { hidden: true }` .
339343
340344` ` ` JavaScript
341345ipfs .util .addFromFs (' path/to/a/folder' , { recursive: true , ignore: [' subfolder/to/ignore/**' ]}, (err , result ) => {
0 commit comments