-// ----------- Create the certificates if they don't already exist -----------
-peertubeCrypto.createCertsIfNotExist(function (err) {
- if (err) throw err
- // Create/activate the webtorrent module
- webtorrent.create(function () {
- function cleanForExit () {
- utils.cleanForExit(webtorrent.app)
- }
-
- function exitGracefullyOnSignal () {
- process.exit(-1)
- }
-
- process.on('exit', cleanForExit)
- process.on('SIGINT', exitGracefullyOnSignal)
- process.on('SIGTERM', exitGracefullyOnSignal)
-
- // ----------- Make the server listening -----------
- server.listen(port, function () {
- // Activate the pool requests
- poolRequests.activate()
-
- videos.seedAllExisting(function () {
- logger.info('Seeded all the videos')