aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
blob: 61eb331ca30f7162b937a4b7d23637bead02c981 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * server.js
 * Copyright (c) 2019, Texx
 * License: MIT
 *     See https://github.com/texxme/Texx/blob/master/LICENSE
 */

/**
 * This script should only be used on a deployment server.
 * For debugging purposes please use 'npm run dev'
 */
const PeerServer = require('peer').PeerServer;

const server = PeerServer({
  debug: true,
  port: 4242,
  path: '/api',
});

server.on('connection', id => console.log(`New connection: ${id}`));