Fix auth keys

This commit is contained in:
Ian Ramzy 2020-04-06 11:17:07 -04:00
parent b20df58b35
commit 0182d38e71
4 changed files with 13 additions and 6 deletions

5
.env.template vendored Normal file
View File

@ -0,0 +1,5 @@
# Required for all uses
# It takes 2 mins to get a free twilio account https://www.twilio.com/login
TWILIO_ACCOUNT_SID=ACfc9705a2b725a7a314995eb8635a9079
LOCAL_AUTH_TOKEN=654560d5d03db5548733959aa49b55bb

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules/
.DS_Store
/.idea
.env

1
README.md vendored
View File

@ -6,7 +6,6 @@
[![Repo Link](https://img.shields.io/badge/Repo-Link-black.svg)](https://github.com/ianramzy/decentralized-video-chat)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?)](https://github.com/prettier/prettier)
# https://zipcall.io
Decentralized video chat platform powered by WebRTC using Twilio STUN/TURN infrastructure.

View File

@ -1,9 +1,11 @@
require("dotenv").config();
var sslRedirect = require("heroku-ssl-redirect");
var twilio = require("twilio")(
process.env.TWILIO_ACCOUNT_SID,
process.env.AUTH_TOKEN
);
// Get twillio auth and SID from heroku if deployed, else get from local .env file
var twillioAuthToken =
process.env.HEROKU_AUTH_TOKEN || process.env.LOCAL_AUTH_TOKEN;
var twillioAccountSID =
process.env.HEROKU_TWILLIO_SID || process.env.LOCAL_TWILLIO_SID;
var twilio = require("twilio")(twillioAccountSID, twillioAuthToken);
var express = require("express");
var app = express();
var http = require("http").createServer(app);