mirror of https://github.com/kern/filepizza
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
299 B
JavaScript
17 lines
299 B
JavaScript
import uuid from 'node-uuid';
|
|
|
|
let id = uuid.v4();
|
|
|
|
if (typeof window === 'undefined') {
|
|
var peer = { id: id };
|
|
} else {
|
|
let Peer = require('peerjs');
|
|
var peer = new Peer(id, {
|
|
host: window.location.hostname,
|
|
port: window.location.port,
|
|
path: '/peer'
|
|
});
|
|
}
|
|
|
|
export default peer;
|