git ssb

0+

mixmix / ssb-server-plugin-intro



Tree: 8c71e9c979626faf9b3d2a3f9293a285ba56d033

Files: 8c71e9c979626faf9b3d2a3f9293a285ba56d033 / 2_actual_friends / server.js

708 bytesRaw
1const Server = require('scuttlebot')
2const fs = require('fs')
3const Path = require('path')
4
5const config = require('./config')
6console.log('config:', config)
7
8console.log('*** installing ssb-server plugins ***')
9Server
10 .use(require('scuttlebot/plugins/master'))
11 .use(require('./ssb-server-actual-friends'))
12
13console.log('*** starting ssb-server ***')
14const server = Server(config)
15
16console.log('*** updating manifest ***')
17// this is required for ssb-client to consume
18// it's a list of methods that can be called remotely, without this code we won't be able to call our new plugin
19const manifest = server.getManifest()
20fs.writeFileSync(Path.join(config.path, 'manifest.json'), JSON.stringify(manifest))
21

Built with git-ssb-web