Commit 1fa83afef777f28f13f52b22b0c8ce690c8eecb0
better params
andre alves garzia authored on 7/13/2018, 2:57:20 PMHenry committed on 9/4/2018, 4:46:02 PM
Parent: 4a030f061750b955cc3028f04d0cf62248113251
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