feat: generalize examples

This commit is contained in:
nanov
2019-12-18 16:48:05 +02:00
parent fcbf4ca165
commit f6dfdf4c40
15 changed files with 85 additions and 107 deletions

21
examples/getClient.js Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
const { Client, fsKeysStorage } = require('../index');
const loadConfig = require('./loadConfig');
module.exports = ({
serverAddress,
partnerId,
userId,
hostId,
passphrase,
keyStoragePath,
} = loadConfig()) => new Client({
serverAddress,
partnerId,
userId,
hostId,
passphrase,
keyStorage: fsKeysStorage(keyStoragePath),
});