Skip to content

Commit e54b7d6

Browse files
committed
Remove createServer function from main bin
1 parent a710e3f commit e54b7d6

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

bin/index.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ async function main () {
6969
// Else, use ~/.hyperspace/storage
7070
const storage = argv.storage ? argv.storage : await getStoragePath()
7171

72-
const s = createServer(storage, argv)
72+
const s = new Server({
73+
host: argv.host,
74+
port: argv.port,
75+
storage,
76+
network: argv.bootstrap ? { bootstrap: [].concat(argv.bootstrap) } : null,
77+
noAnnounce: !argv.announce,
78+
noMigrate: !argv.migrate
79+
})
80+
7381
global.hyperspace = s
7482

7583
if (!argv.repl) {
@@ -126,17 +134,6 @@ async function main () {
126134
}
127135
}
128136

129-
function createServer (storage, opts) {
130-
return new Server({
131-
host: opts.host,
132-
port: opts.port,
133-
storage,
134-
network: opts.bootstrap ? { bootstrap: [].concat(opts.bootstrap) } : null,
135-
noAnnounce: !opts.announce,
136-
noMigrate: !opts.migrate
137-
})
138-
}
139-
140137
async function getStoragePath () {
141138
try {
142139
// If this dir exists, use it.

0 commit comments

Comments
 (0)