diff --git a/package.json b/package.json index b428c47..eb98b64 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "dependencies": { "express": "^4.17.1", "peer": "^0.5.3", - "ejs": "^3.1.5" + "ejs": "^3.1.5", + "dotenv": "^8.2.0" }, "engines": { "node": "12.x" diff --git a/public/main.js b/public/main.js index d786e54..df0fe73 100644 --- a/public/main.js +++ b/public/main.js @@ -10,9 +10,9 @@ var app = new Vue({ 'iceServers': [ { urls: 'stun:stun.snikket.freeddns.org:3478' }, { - urls: 'turn:turn.snikket.freeddns.org:3478', - username: window.TURN_USER_SKT, - credential: window.TURN_PW_SKT + urls: , + username: window.TURN_USER, + credential: window.TURN_PW } ], 'sdpSemantics': 'unified-plan', diff --git a/public/index.html b/public/old.html similarity index 100% rename from public/index.html rename to public/old.html diff --git a/server.js b/server.js index 51c96f2..c520cbc 100644 --- a/server.js +++ b/server.js @@ -1,12 +1,11 @@ // server.js // where your node app starts +require('dotenv').config(); // we've started you off with Express (https://expressjs.com/) // but feel free to use whatever libraries or frameworks you'd like through `package.json`. const express = require("express"); - const { ExpressPeerServer } = require("peer"); - const app = express(); // make all the files in 'public' available @@ -18,8 +17,9 @@ app.set('view engine', 'ejs'); app.get("/", (request, response) => { // response.sendFile(__dirname + "/public/index.html"); response.render('index', { - TURN_USER_SKT: "a", - TURN_PW_SKT: "b" + TURN_USER: process.env.TURN_USER, + TURN_PW: process.env.TURN_PW, + TURN_URL: process.env.TURN_URL }); }); diff --git a/shrinkwrap.yaml b/shrinkwrap.yaml index f9e2e30..e50d6bc 100644 --- a/shrinkwrap.yaml +++ b/shrinkwrap.yaml @@ -1,4 +1,5 @@ dependencies: + dotenv: 8.2.0 ejs: 3.1.5 express: 4.17.1 peer: 0.5.3 @@ -251,6 +252,12 @@ packages: dev: false resolution: integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + /dotenv/8.2.0: + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== /ee-first/1.1.1: dev: false resolution: @@ -793,6 +800,7 @@ registry: 'https://registry.npmjs.org/' shrinkwrapMinorVersion: 9 shrinkwrapVersion: 3 specifiers: + dotenv: ^8.2.0 ejs: ^3.1.5 express: ^4.17.1 peer: ^0.5.3 diff --git a/views/index.ejs b/views/index.ejs index cbd4b2d..7a79416 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -8,8 +8,9 @@