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

Commit 43d39ce

Browse files
committed
docs: update .name API example
1 parent 16a3572 commit 43d39ce

File tree

5 files changed

+1968
-14
lines changed

5 files changed

+1968
-14
lines changed

examples/name-api/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
## Setup
44

5-
Install [go-ipfs](https://ipfs.io/docs/install/) and start the daemon
5+
Install [go-ipfs](https://ipfs.io/docs/install/) and start the daemon.
6+
7+
Configure CORS as suggested by the README https://github.com/ipfs/js-ipfs-api#cors
68

79
```bash
8-
$ ipfs daemon
10+
> ipfs daemon
911
```
1012

1113
then in this folder run
1214

1315
```bash
14-
$ npm install
15-
$ npm start
16+
> npm install
17+
> npm start
1618
```
1719

1820
and open your browser at `http://localhost:8888`.

examples/name-api/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h3>Resolve an IPNS name</h3>
5858
</p>
5959
</div>
6060

61-
<script src="https://npmcdn.com/ipfs-api/dist/index.js"></script>
61+
<script src="https://unpkg.com/ipfs-api/dist/index.js"></script>
6262
<script src="bundle.js"></script>
6363
</body>
6464
</html>

examples/name-api/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const ipfs = window.IpfsApi()
3+
const ipfs = window.IpfsApi('/ip4/127.0.0.1/tcp/5001')
44

55
const DOM = {
66
status: document.getElementById('status'),

0 commit comments

Comments
 (0)