Commit 62ff49458ab485251bd04867309ec994c88fec21
better params
andre alves garzia committed on 7/13/2018, 2:57:20 PMParent: 4829e1570bc2557c4ca55113e3e7d4ffff3fd4e9
Files changed
examples/launch_sbot_custom_plugin.js | changed |
server.js | changed |
examples/launch_sbot_custom_plugin.js | ||
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | 1 … | let scuttleshell = require("../server") |
2 | 2 … | |
3 | 3 … | console.log("Starting sbot, quitting after 30 seconds") |
4 | 4 … | console.log("open http://localhost:8989/get-address") |
5 | -scuttleshell.start(false, ["./examples/service-discovery"]) | |
5 … | +scuttleshell.start({ plugins: ["./examples/service-discovery"] }) | |
6 | 6 … | |
7 | 7 … | setTimeout(scuttleshell.stop, 30000) |
server.js | |||
---|---|---|---|
@@ -7,10 +7,13 @@ | |||
7 | 7 … | const notifier = require('node-notifier') | |
8 | 8 … | const SysTray = require('systray').default | |
9 | 9 … | let tray = {} | |
10 | 10 … | ||
11 | -function start(appname, customPluginPaths) { | ||
11 … | +function start(customConfig) { | ||
12 | 12 … | ||
13 … | + customConfig = customConfig || {} | ||
14 … | + let appname = customConfig.appname || false | ||
15 … | + let customPluginPaths = customConfig.plugins || false | ||
13 | 16 … | let argv = process.argv.slice(2) | |
14 | 17 … | let i = argv.indexOf('--') | |
15 | 18 … | let conf = argv.slice(i + 1) | |
16 | 19 … | argv = ~i ? argv.slice(0, i) : argv | |
Built with git-ssb-web