MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / setEndpoint

Function setEndpoint

vision/setEndpoint.js:27–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 const vision = require('@google-cloud/vision');
26
27 async function setEndpoint() {
28 // Specifies the location of the api endpoint
29 const clientOptions = {apiEndpoint: 'eu-vision.googleapis.com'};
30
31 // Creates a client
32 const client = new vision.ImageAnnotatorClient(clientOptions);
33
34 // Performs text detection on the image file
35 const [result] = await client.textDetection('./resources/wakeupcat.jpg');
36 const labels = result.textAnnotations;
37 console.log('Text:');
38 labels.forEach(label => console.log(label.description));
39 }
40 setEndpoint();
41 // [END vision_set_endpoint]
42}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected