This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('path'); | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const NCCO_CONNECT = [{ | |
"action": "stream", | |
"streamUrl": [`${process.env.BASE_URL}/greet.mp3`] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"action": "talk", | |
"text": "Welcome to a Voice API I V R. ", | |
"voiceName": "Amy", | |
"bargeIn": false | |
}, | |
{ | |
"action": "talk", | |
"text": "Press 1 for maybe and 2 for not sure followed by the hash key", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('path'); | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const NCCO_INITIAL_PROMPT = [{ | |
"action": "stream", | |
"streamUrl": [`${process.env.BASE_URL}/prompt.mp3`], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Stream = require('stream'); | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (url, key) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const debug = require('debug'); | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const log = debug('store'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const http = require('http'); | |
const fs = require('fs'); | |
// fetch binary from `url` and upload to local file using `dest` as destination | |
const store = (url, dest) => { | |
return new Promise((resolve, reject) => { | |
http.get(url).on('error', (e) => { | |
// something went wrong during fetch avatar. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const request = require('request'); | |
const fs = require('fs'); | |
// fetch binary from `url` and upload to local file using `dest` as destination | |
const store = (url, dest) => { | |
return new Promise((resolve, reject) => { | |
request({ | |
method: 'GET', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const request = require('request'); | |
const fs = require('fs'); | |
// fetch binary from `url` and upload to local file using `dest` as destination | |
const store = (url, dest) => { | |
return new Promise((resolve, reject) => { | |
request({ | |
method: 'GET', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const http = require('http'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (url, key) => { | |
return new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (path, key) => { |