Skip to content

Commit

Permalink
Minor tweaks to simplify sample configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gus Class committed Oct 10, 2016
1 parent 896f39a commit 6b7d567
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 2 additions & 4 deletions vision/explore-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ This directory contains [Cloud Vision API](https://cloud.google.com/vision/) Cli


## Setup
1. Create a file named *key.js*
2. Create the line `var apiKey = 'YOUR API KEY HERE';`
3. Save file
4. Browse to index.html, and run through demo
1. Update the line `var apiKey = 'YOUR API KEY HERE';` in *key.js* with your API key.
2. Start a web server in the sample folder and navigate to index.html.


From here, the demo allows you to upload images and process them using the various [Cloud Vision API annotation types](https://cloud.google.com/vision/reference/rest/v1/images/annotate#Type).
Expand Down
15 changes: 15 additions & 0 deletions vision/explore-api/key.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2016, Google, Inc.
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Replace with the key you created at https://cloud.google.com/console
window.apiKey = 'YOUR API KEY HERE';
2 changes: 0 additions & 2 deletions vision/explore-api/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

'use strict';

// Expecting this line in file named key.js
// window.apiKey = "[YOUR API KEY HERE]"
var CV_URL = 'https://vision.googleapis.com/v1/images:annotate?key=' + window.apiKey;

$(document).ready(function () {
Expand Down

0 comments on commit 6b7d567

Please sign in to comment.