Skip to content

Commit ac97e35

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 ac97e35

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nodejs/Search/BingVisualSearchv7.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ var request = require('request');
22
var FormData = require('form-data');
33
var fs = require('fs');
44

5-
var baseUri = 'https://api.cognitive.microsoft.com/bing/v7.0/images/visualsearch';
6-
var subscriptionKey = 'your-susbcription-key';
5+
// Add your Bing Search V7 endpoint to your environment variables.
6+
var baseUri = process.env['BING_SEARCH_V7_ENDPOINT'] + '/bing/v7.0/images/visualsearch';
7+
// Add your Bing Search V7 subscription key to your environment variables.
8+
var subscriptionKey = process.env['BING_SEARCH_V7_SUBSCRIPTION_KEY']
79
var imagePath = "path-to-your-image";
810

911
var form = new FormData();
@@ -21,4 +23,4 @@ form.getLength(function(err, length){
2123

2224
function requestCallback(err, res, body) {
2325
console.log(JSON.stringify(JSON.parse(body), null, ' '))
24-
}
26+
}

0 commit comments

Comments
 (0)