Commit 2fc72eabdc230a249add2e43b028b0a467a317c2
rename background-process.js server.js
mixmix committed on 10/29/2018, 5:20:55 AMParent: 2840c9e48caac44fec4836e75b31d7e2d75039e0
Files changed
index.js | changed |
main.js | changed |
background-process.js | deleted |
server.js | added |
index.js | |||
---|---|---|---|
@@ -75,9 +75,9 @@ | |||
75 | 75 … | }) | |
76 | 76 … | ||
77 | 77 … | function startBackgroundProcess () { | |
78 | 78 … | if (!windows.background) { | |
79 | - windows.background = openWindow(Path.join(__dirname, 'background-process.js'), { | ||
79 … | + windows.background = openWindow(Path.join(__dirname, 'server.js'), { | ||
80 | 80 … | connect: false, | |
81 | 81 … | center: true, | |
82 | 82 … | fullscreen: false, | |
83 | 83 … | fullscreenable: false, |
main.js | ||
---|---|---|
@@ -33,20 +33,21 @@ | ||
33 | 33 … | module.exports = patchbay |
34 | 34 … | |
35 | 35 … | // for electro[n] |
36 | 36 … | if (typeof window !== 'undefined') { |
37 | - // modules loaded first over-ride core modules loaded later | |
38 | - const sockets = combine( | |
37 … | + // TODO spin up settings check which modules are wanted | |
38 … | + const plugins = [ | |
39 | 39 … | require('patchbay-scry'), |
40 | 40 … | require('patchbay-dark-crystal'), |
41 | 41 … | require('patchbay-poll'), |
42 … | + require('patch-inbox'), // TODO needs work | |
42 | 43 … | require('ssb-chess-mithril'), |
43 | - require('patchbay-gatherings'), | |
44 | 44 … | require('patchbay-book'), |
45 | - require('patch-inbox'), // TODO needs work | |
46 | - patchbay, | |
47 | - patchcore | |
48 | - ) | |
45 … | + require('patchbay-gatherings') | |
46 … | + ] | |
47 … | + const args = [ ...plugins, patchbay, patchcore ] | |
48 … | + // plugings loaded first will over-ride core modules loaded later | |
49 … | + const sockets = combine.apply(null, args) | |
49 | 50 … | |
50 | 51 … | const api = entry(sockets, nest('app.html.app', 'first')) |
51 | 52 … | document.body.appendChild(api.app.html.app()) |
52 | 53 … | } |
background-process.js | ||
---|---|---|
@@ -1,34 +1,0 @@ | ||
1 | -var fs = require('fs') | |
2 | -var Path = require('path') | |
3 | -var electron = require('electron') | |
4 | - | |
5 | -console.log('STARTING SBOT') | |
6 | - | |
7 | -var createSbot = require('scuttlebot') | |
8 | - .use(require('scuttlebot/plugins/master')) | |
9 | - .use(require('scuttlebot/plugins/gossip')) | |
10 | - .use(require('scuttlebot/plugins/replicate')) | |
11 | - .use(require('scuttlebot/plugins/invite')) | |
12 | - .use(require('scuttlebot/plugins/local')) | |
13 | - .use(require('scuttlebot/plugins/logging')) | |
14 | - .use(require('ssb-about')) | |
15 | - .use(require('ssb-backlinks')) | |
16 | - .use(require('ssb-blobs')) | |
17 | - .use(require('ssb-chess-db')) | |
18 | - .use(require('ssb-ebt')) | |
19 | - .use(require('ssb-friends')) | |
20 | - .use(require('ssb-meme')) | |
21 | - .use(require('ssb-private')) | |
22 | - .use(require('ssb-query')) | |
23 | - .use(require('ssb-search')) | |
24 | - .use(require('ssb-unread')) | |
25 | - .use(require('ssb-ws')) | |
26 | - // .use(require('ssb-mutual')) // this is has recursion problems atm | |
27 | - | |
28 | -// pull config options out of depject | |
29 | -var config = require('./config').create().config.sync.load() | |
30 | - | |
31 | -var sbot = createSbot(config) | |
32 | -var manifest = sbot.getManifest() | |
33 | -fs.writeFileSync(Path.join(config.path, 'manifest.json'), JSON.stringify(manifest)) | |
34 | -electron.ipcRenderer.send('server-started') |
server.js | ||
---|---|---|
@@ -1,0 +1,35 @@ | ||
1 … | +// formerly background-process.js | |
2 … | +var fs = require('fs') | |
3 … | +var Path = require('path') | |
4 … | +var electron = require('electron') | |
5 … | + | |
6 … | +console.log('STARTING SBOT') | |
7 … | + | |
8 … | +var createSbot = require('scuttlebot') | |
9 … | + .use(require('scuttlebot/plugins/master')) | |
10 … | + .use(require('scuttlebot/plugins/gossip')) | |
11 … | + .use(require('scuttlebot/plugins/replicate')) | |
12 … | + .use(require('scuttlebot/plugins/invite')) | |
13 … | + .use(require('scuttlebot/plugins/local')) | |
14 … | + .use(require('scuttlebot/plugins/logging')) | |
15 … | + .use(require('ssb-about')) | |
16 … | + .use(require('ssb-backlinks')) | |
17 … | + .use(require('ssb-blobs')) | |
18 … | + .use(require('ssb-chess-db')) | |
19 … | + .use(require('ssb-ebt')) | |
20 … | + .use(require('ssb-friends')) | |
21 … | + .use(require('ssb-meme')) | |
22 … | + .use(require('ssb-private')) | |
23 … | + .use(require('ssb-query')) | |
24 … | + .use(require('ssb-search')) | |
25 … | + .use(require('ssb-unread')) | |
26 … | + .use(require('ssb-ws')) | |
27 … | + // .use(require('ssb-mutual')) // this is has recursion problems atm | |
28 … | + | |
29 … | +// pull config options out of depject | |
30 … | +var config = require('./config').create().config.sync.load() | |
31 … | + | |
32 … | +var sbot = createSbot(config) | |
33 … | +var manifest = sbot.getManifest() | |
34 … | +fs.writeFileSync(Path.join(config.path, 'manifest.json'), JSON.stringify(manifest)) | |
35 … | +electron.ipcRenderer.send('server-started') |
Built with git-ssb-web