Giter Club home page Giter Club logo

browser-calls-node's Introduction

Browser Calls. Powered by Twilio - Node.js/Express

Build Status

Learn how to use Twilio Client to make browser-to-phone and browser-to-browser calls with ease. The unsatisfied customers of the Birchwood Bicycle Polo Co. need your help!

Quickstart

Create a TwiML App

This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.

Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid as the TWIML_APP_SID environment variable wherever you run this app.

Creating a TwiML App

See the end of the "Local development" section for details on the exact URL to use in your TwiML app.

Once you have created your TwiML app, configure your Twilio phone number to use it (instructions here). If you don't have a Twilio phone number yet, you can purchase a new number in your Twilio Account Dashboard.

Local development

First you need to install either Node.js or io.js, both of which should also install npm.

  1. This sample application stores data in a MongoDB database using Mongoose. You can download and run MongoDB yourself (OS X, Linux, Windows).

    On OS X, maybe the easiest way to get MongoDB running locally is to install via Homebrew.

    $ brew install mongodb
    

    You should then be able to run a local server with:

    $ mongod
    

To run the app locally, clone this repository and cd into its directory:

  1. First clone this repository and cd into its directory:

    git clone [email protected]:TwilioDevEd/browser-calls-node.git
    
    cd browser-calls-node
    
  2. Install dependencies:

    npm install
    
  3. Edit the sample configuration file .env to match your configuration.

    Once you have edited the .env file, if you are using a UNIX operating system, just use the source command to load the variables into your environment:

$ source .env
  1. Run the application.

    node .
    

    Alternatively you might also consider using nodemon for this. It works just like the node command, but automatically restarts your application when you change any source code files.

    npm install -g nodemon
    nodemon .
    
  2. Run the application.

$ npm start

To actually forward incoming calls, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

Once you have started ngrok, update your TwiML app's voice URL setting to use your ngrok hostname, so it will look something like this:

http://88b37ada.ngrok.io/call/connect
  1. Check it out at http://localhost:3000

That's it

Run the tests

You can run the tests locally by typing

mocha test

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

browser-calls-node's People

Contributors

nebtrx avatar jarodreyes avatar eddiezane avatar

Watchers

James Cloos avatar Sean Chappy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.