Created
December 10, 2019 12:02
-
-
Save colibie/ea839e647f7f873b9920d279c946cd4c to your computer and use it in GitHub Desktop.
A gist that contains the setup configuration for text anaytics api
This file contains 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
const key_var = 'TEXT_ANALYTICS_SUBSCRIPTION_KEY'; | |
if (!process.env[key_var] && !config[key_var]) { | |
throw new Error('please set/export the following environment variable: ' + key_var); | |
} | |
const subscription_key = process.env[key_var] || config[key_var]; | |
const endpoint_var = 'TEXT_ANALYTICS_ENDPOINT'; | |
if (!process.env[endpoint_var] && !config[endpoint_var]) { | |
throw new Error('please set/export the following environment variable: ' + endpoint_var); | |
} | |
const endpoint = process.env[endpoint_var] || config[endpoint_var]; | |
let pathForLanguages = '/v2.1/languages'; | |
let pathForSentiments = '/v2.1/sentiment'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment