Skip to content

Commit d84b8e4

Browse files
authored
Updated key/endpoint
Endpoints are not region-based anymore, but rather custom domain -based. Although regional endpoints will still work. Also, the authentication information is moving to a standard of getting it from environment variables.
1 parent 0d20f1e commit d84b8e4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nodejs/Search/BingSpellCheckv7.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
let https = require ('https');
44

5-
let host = 'api.cognitive.microsoft.com';
5+
// Add your Bing Spell Check endpoint to your environment variables.
6+
let host = process.env['BING_SPELL_CHECK_ENDPOINT']
67
let path = '/bing/v7.0/spellcheck';
78

8-
/* NOTE: Replace this example key with a valid subscription key (see the Prequisites section above). Also note v5 and v7 require separate subscription keys. */
9-
let key = 'ENTER KEY HERE';
9+
// Add your Bing Spell Check subscription key to your environment variables.
10+
// Also note v5 and v7 require separate subscription keys.
11+
let key = process.env['BING_SPELL_CHECK_SUBSCRIPTION_KEY']
1012

1113
// These values are used for optional headers (see below).
1214
// let CLIENT_ID = "<Client ID from Previous Response Goes Here>";
@@ -47,4 +49,4 @@ let response_handler = function (response) {
4749

4850
let req = https.request (request_params, response_handler);
4951
req.write ("text=" + text);
50-
req.end ();
52+
req.end ();

0 commit comments

Comments
 (0)