{"size": 1106, "ext": "js", "max_stars_repo_path": "gulp-lib/browser-sync-multi.js", "max_stars_repo_name": "cwel-team/cwel", "max_stars_repo_stars_event_min_datetime": "2018-01-19T09:32:29.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-12T10:27:28.000Z", "max_issues_repo_path": "gulp-lib/browser-sync-multi.js", "max_issues_repo_name": "cwel-team/cwel", "max_issues_repo_issues_event_min_datetime": "2018-02-22T08:28:31.000Z", "max_issues_repo_issues_event_max_datetime": "2018-03-16T11:11:03.000Z", "max_forks_repo_path": "gulp-lib/browser-sync-multi.js", "max_forks_repo_name": "cwel-team/cwel", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 8, "max_issues_count": 14, "max_forks_count": null, "avg_line_length": 20.4814814815, "max_line_length": 45, "alphanum_fraction": 0.4493670886}
const browserSync = require('browser-sync');

const notifyStyles = [
    'display: none',
    'z-index: 9999',
    'position: fixed',
    'left: 0',
    'bottom: 0',
    'width: 100%',
    'margin: 0',
    'padding: 10px',
    'font-family: sans-serif',
    'font-size: 12px',
    'text-align: center',
    'color: #fff',
    'background-color: #2a2a2a',
];

class MultiSync {
    constructor() {
        this.docsSync = browserSync.create();
        this.sandSync = browserSync.create();
    }
    init() {
        this.docsSync.init({
            server: 'tmp/docs',
            port: 3000,
            ui: {
                port: 3001,
            },
            notify: {
                styles: notifyStyles,
            },
        });
        this.sandSync.init({
            server: 'tmp/sandbox',
            port: 3030,
            ui: {
                port: 3031,
            },
            notify: {
                styles: notifyStyles,
            },
        });
    }

    reload() {
        this.docsSync.reload();
        this.sandSync.reload();
    }
}

module.exports = new MultiSync();
