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