EasyRTC project structure

62 views
Skip to first unread message

Victor Denisenko

unread,
Feb 26, 2019, 8:32:59 AM2/26/19
to EasyRTC
In the main EsyRTC example from GitHub is written (see server.js file): 

// This sample is using the easyrtc from parent folder.
// To use this server_example folder only without parent folder:
// 1. you need to replace this "require("../");" by "require("easyrtc");"
// 2. install easyrtc (npm i easyrtc --save) in server_example/package.json

I would like to use server_example folder only without parent folder, I did all like here is written, after that I put all the content from demos folder to easyrtc-master\server_example\static folder. Server starts, but examples does not work. Why? What is the right project folder structure for this case? 
  

THE BIG SKULL

unread,
Feb 26, 2019, 9:03:52 AM2/26/19
to EasyRTC
Are you accessing it like this in the browser?


If I am understanding correctly you're just moving the files from "demos" to the "static" folder. Not sure what the reasoning is for this. You could just simply go to https://your-URL.com:8443/demos

Victor Denisenko

unread,
Feb 26, 2019, 9:46:53 AM2/26/19
to EasyRTC
I use localhost, http://localhost:8080/ (this is default page, where I see list of examples), I choose needed example and go to the page like for example http://localhost:8080/demo_audio_video_simple.html.

If I go to http://localhost:8080/static/demo_audio_video_simple.html, then I see "Cannot GET /static/demo_audio_video_simple.html", it is because 'static' folder is chosen as a web root. 

>You could just simply go to https://your-URL.com:8443/demos
- but as we can see in "server_example\node_modules\easyrtc\server_example\README.md", that "/static/ - Root folder for web server. Put html files here!". That means I need to put  the files from "demos" to the "static" folder. Is that right?

THE BIG SKULL

unread,
Feb 26, 2019, 10:11:32 AM2/26/19
to EasyRTC
When we install it, the path to the demos is  ("http://localhost:8080/demos/")  we never had a reason to change where the demos were located.

Victor Denisenko

unread,
Feb 26, 2019, 10:24:48 AM2/26/19
to EasyRTC
Ok, but how to use server_example folder only without parent folder? Or it is impossible to use server_example folder without parent folder?

It doesn't work without parent folder. As soon as I change  "require("../");" by "require("easyrtc");" and  install easyrtc (npm i easyrtc --save) in server_example/package.json, I cannot launch any example, no matter where I get it. 

THE BIG SKULL

unread,
Feb 26, 2019, 10:41:45 AM2/26/19
to EasyRTC
Maybe you should look into changing this in the server.js file.

// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));



Victor Denisenko

unread,
Feb 26, 2019, 11:02:11 AM2/26/19
to EasyRTC
I used before 

var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic('static', {'index': ['index.html']}));

I did like you advised too. Result is the same. I see the html pages (), but there are no video (no 'selfVideo, no 'callerVideo'. But it works fine if I use parent folder.

THE BIG SKULL

unread,
Feb 26, 2019, 11:10:12 AM2/26/19
to EasyRTC
Have you looked at this, especially the last post.


Victor Denisenko

unread,
Feb 26, 2019, 11:29:14 AM2/26/19
to EasyRTC
Thank you, I looked there just now. The difference is my server sees html and js files and I see them in browser and in Developer mode, but there are not video only. Chrome debugger do not give any error, all works, but I do not see videos.

THE BIG SKULL

unread,
Feb 26, 2019, 12:02:51 PM2/26/19
to EasyRTC
I found this... Not sure if its of any help. If you are new to easyRTC, save yourself a lot of headache and use something like  http://www.kurento.org/  easyRTC is a mess, always has been. Works okay for a few things, but other than that, expect headaches.

Victor Denisenko

unread,
Feb 26, 2019, 12:44:40 PM2/26/19
to EasyRTC
Thank you, I will see.

THE BIG SKULL

unread,
Feb 26, 2019, 2:58:51 PM2/26/19
to EasyRTC
Have you tried removing the ststic path?

// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));   <--- try removing that like below.



// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + " "));
Reply all
Reply to author
Forward
0 new messages