Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 06aa615

Browse files
committed
refactor: reorg + fix lint
1 parent 0bdd2ed commit 06aa615

File tree

7 files changed

+7
-4
lines changed

7 files changed

+7
-4
lines changed

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ Let us know if you find any issue or if you want to contribute and add a new tut
1111
- [How to bundle js-ipfs with WebPack](/bundle-webpack)
1212

1313
## Tutorials
14+
15+
- [Transfer files between a Browser node and Desktop node](/transfer-files)

examples/access-go-ipfs-files/cat-a-file/package.json renamed to examples/transfer-files/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
2-
"name": "cat-a-file",
2+
"name": "transfer-files",
33
"version": "1.0.0",
4-
"description": "",
54
"scripts": {
65
"postinstall": "cp ../../../dist/index.js ./public/ipfs.js",
76
"start": "http-server -c-1"
87
},
9-
"author": "Haad",
108
"license": "MIT",
119
"devDependencies": {
1210
"http-server": "^0.9.0"

examples/access-go-ipfs-files/cat-a-file/public/start-ipfs.js renamed to examples/transfer-files/public/start-ipfs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict'
2+
/* eslint max-nested-callbacks: ["error", 8] */
23

34
// Start an IPFS instance
45
window.startIpfs = (options, callback) => {
@@ -19,7 +20,7 @@ window.startIpfs = (options, callback) => {
1920
const host = options.SignalServer.split(':')[0] || '127.0.0.1'
2021
const port = options.SignalServer.split(':')[1] || 9090
2122
const signalServer = `/libp2p-webrtc-star/ip4/${host}/tcp/${port}/ws/ipfs/${config.Identity.PeerID}`
22-
23+
2324
config.Addresses = {
2425
Swarm: [
2526
signalServer
@@ -35,8 +36,10 @@ window.startIpfs = (options, callback) => {
3536

3637
node.load((err) => {
3738
if (err) { return callback(err) }
39+
3840
node.goOnline((err) => {
3941
if (err) { return callback(err) }
42+
4043
console.log('IPFS node is ready')
4144
callback(null, node)
4245
})

0 commit comments

Comments
 (0)