Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm-debug.log
node_modules
package-lock.json
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,20 @@ NOTE: You should not use Twilio Functions to generate capability tokens for your

[Visit our guide](https://www.twilio.com/docs/voice/client/capability-tokens) to learn how to generate capability tokens in your own C#, Java, Node.js, PHP, Python, or Ruby application.

## Setting up a local HTTP server
## Running the app

You'll need to load the front end of your web application from a web server for Twilio Client to connect successfully from Chrome (it should work in Firefox if you load it from the file system). The easiest way to do that is to install a local HTTP server like [http-server](https://github.com/indexzero/http-server)
It only left to run our application

```bash
npm install http-server -g
npm install
```

or
and

```bash
sudo npm install http-server -g
node index.js
```

on macOS or Linux


## Run the local server

```bash
Expand Down
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const express = require('express');
const path = require('path');
const http = require('http');

const app = express();

app.use(express.static(path.join(__dirname, '/public')));

app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '/public/index.html'));
});

const port = '7001';
app.set('port', port);

const server = http.createServer(app);

server.listen(port, () => console.log(`Magic Happens on port:${port}`));
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "client-quickstart",
"version": "1.0.0",
"description": "<a href=\"https://www.twilio.com\">\r <img src=\"https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg\" alt=\"Twilio\" width=\"250\" />\r </a>",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/thianlopezz/client-quickstart-js.git"
},
"author": "TwilioDevEd",
"license": "ISC",
"bugs": {
"url": "https://github.com/TwilioDevEd/client-quickstart-js/issues"
},
"homepage": "https://github.com/TwilioDevEd/client-quickstart-js#readme",
"dependencies": {
"express": "^4.16.4"
}
}