node.js - Merge webrtc with node server -
I have applied MEAN.js with WebRTC application with nodes. Js server and live video chat. Both applications (separately) works correctly. Now I need to integrate WebRT with MEAN.js application. There is a node server.js file in the MEAN.js app (on port 3000):
'strict experiment'; / ** * module dependency * / var init = is required ('./config / init') (), config = require ('./config / config'), Mangosos = required ('magos' ); / ** * Main app listing file * Please note that the order of loading is important. * / / / Bootstrap db connection var db = mongoose.connect (config.db, function (error) {if (err) {console.error ('\ x1b [31m', 'Could not connect to MongoDB!'); Console .log (mistake);}}); // Init Express app var app = required ('./config / express') (db); // Bootstrap Passport Configuration Required ('./config / passport') (); // launching the app & lt; Port & gt; App.listen (config.port); // Expo App Export = Module Exports = app; // Logging Initialization console.log ('started on MEAN.JS Application Port' + config.port); and WebRTC (on port 8080) is the server.js file:
// Load required module var http = requirement ("http"); // HTTP server core module var expression = requirement ("express"); // Web Framework External Module var io = Requirement ("socket.io"); // Web Socket External Modules require var easyrtc = ("Easy RTC"); // EasyRTC External Module // Setup and Configure Express HTTP Server Expect the subfolders named "Static" to be web root var httpApp = express (); HttpApp.use (express.static (__DERNAM + "/ static /")); // Port 8080 var webServer = http.createServer (httpApp) .listen (8080) Start Express http server; // Start Socket.io, so this server connects itself to Express Works Server Socket Server = io.listen (Web server, {"Log Level": 1}); // Start EasyRTC server var rtc = easyrtc.listen (httpApp, socketServer); To make MEAN.js work together with WebRTC, these two servers. Do you know how to merge JS files into one? thank you in advanced.
Comments
Post a Comment