Fix linting errors, export mediasoup server
parent
f44bde4ef4
commit
313ce81685
|
|
@ -15,9 +15,7 @@ const gulp = require('gulp');
|
||||||
const plumber = require('gulp-plumber');
|
const plumber = require('gulp-plumber');
|
||||||
const eslint = require('gulp-eslint');
|
const eslint = require('gulp-eslint');
|
||||||
|
|
||||||
gulp.task('lint', () =>
|
const LINTING_FILES =
|
||||||
{
|
|
||||||
const src =
|
|
||||||
[
|
[
|
||||||
'gulpfile.js',
|
'gulpfile.js',
|
||||||
'server.js',
|
'server.js',
|
||||||
|
|
@ -25,10 +23,22 @@ gulp.task('lint', () =>
|
||||||
'lib/**/*.js'
|
'lib/**/*.js'
|
||||||
];
|
];
|
||||||
|
|
||||||
return gulp.src(src)
|
gulp.task('lint', () =>
|
||||||
|
{
|
||||||
|
|
||||||
|
return gulp.src(LINTING_FILES)
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(eslint())
|
.pipe(eslint())
|
||||||
.pipe(eslint.format());
|
.pipe(eslint.format());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('lint-fix', function()
|
||||||
|
{
|
||||||
|
return gulp.src(LINTING_FILES)
|
||||||
|
.pipe(plumber())
|
||||||
|
.pipe(eslint({ fix: true }))
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(gulp.dest((file) => file.base));
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('default', gulp.series('lint'));
|
gulp.task('default', gulp.series('lint'));
|
||||||
|
|
|
||||||
|
|
@ -317,3 +317,5 @@ function stdinError(msg)
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(colors.red.bold('ERROR: ') + colors.red(msg));
|
console.error(colors.red.bold('ERROR: ') + colors.red(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default mediaServer;
|
||||||
|
|
@ -21,7 +21,7 @@ console.log('- config.mediasoup.logTags:', config.mediasoup.logTags);
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
|
||||||
// Start the mediasoup server.
|
// Start the mediasoup server.
|
||||||
require('./mediasoup');
|
const mediaServer = require('./mediasoup');
|
||||||
|
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
|
|
||||||
|
|
@ -58,9 +58,11 @@ app.get(
|
||||||
if (rooms.has(req.query.roomId))
|
if (rooms.has(req.query.roomId))
|
||||||
{
|
{
|
||||||
const room = rooms.get(req.query.roomId)._protooRoom;
|
const room = rooms.get(req.query.roomId)._protooRoom;
|
||||||
|
|
||||||
if (room.hasPeer(req.query.peerName))
|
if (room.hasPeer(req.query.peerName))
|
||||||
{
|
{
|
||||||
const peer = room.getPeer(req.query.peerName);
|
const peer = room.getPeer(req.query.peerName);
|
||||||
|
|
||||||
peer.send('auth', {
|
peer.send('auth', {
|
||||||
name : req.user.displayName,
|
name : req.user.displayName,
|
||||||
picture : req.user.photos[0]
|
picture : req.user.photos[0]
|
||||||
|
|
@ -68,12 +70,13 @@ app.get(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
|
||||||
// Serve all files in the public folder as static files.
|
// Serve all files in the public folder as static files.
|
||||||
app.use(express.static('public'));
|
app.use(express.static('public'));
|
||||||
|
|
||||||
const httpsServer = https.createServer(tls, app);
|
const httpsServer = https.createServer(tls, app);
|
||||||
|
|
||||||
httpsServer.listen(config.listeningPort, '0.0.0.0', () =>
|
httpsServer.listen(config.listeningPort, '0.0.0.0', () =>
|
||||||
{
|
{
|
||||||
logger.info('Server running on port: ', config.listeningPort);
|
logger.info('Server running on port: ', config.listeningPort);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue