From 9e6960011b831879af1571bb2f0c1bfcdca4dedb Mon Sep 17 00:00:00 2001 From: Wesley Wong Date: Tue, 11 Oct 2016 14:55:18 -0700 Subject: [PATCH 1/4] Merges the contents of index.html into the README for the Endpoints sample. Removes index.html and adds two new sections in the README for viewing the Endpoints graphs and Swagger UI. --- appengine/flexible/endpoints/README.md | 13 +++++++++++++ appengine/flexible/endpoints/index.html | 19 ------------------- 2 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 appengine/flexible/endpoints/index.html diff --git a/appengine/flexible/endpoints/README.md b/appengine/flexible/endpoints/README.md index c31f528dba0..aff053b4da0 100644 --- a/appengine/flexible/endpoints/README.md +++ b/appengine/flexible/endpoints/README.md @@ -172,3 +172,16 @@ $ gcloud app deploy app.yaml --project=YOUR-CLIENT-PROJECT-ID Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API from the client's service account using Google ID token. + +## Viewing the Endpoints graphs + +By using Endpoints, you get access to several metrics that are displayed graphically in the Cloud Console. + +To view the Endpoints graphs: + +1. Go to the [Endpoints section in Cloud Console](https://console.cloud.google.com/endpoints) of the project you deployed your API to. +2. Click on your API to view more detailed information about the metrics collected. + +## Swagger UI + +The Swagger UI is an open source Swagger project that allows you to explore your API through a UI. Find out more about it on the [Swagger site](http://swagger.io/swagger-ui/). diff --git a/appengine/flexible/endpoints/index.html b/appengine/flexible/endpoints/index.html deleted file mode 100644 index 9774466482f..00000000000 --- a/appengine/flexible/endpoints/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - Codestin Search App - - -

Welcome to your Endpoints Sample

-

Congratulations on successfully setting up and deploying your Endpoints bookstore sample.

-

Here are some helpful links:

- - - From 571ebb2c8ea05fde7b446da2d758786ae6464dbe Mon Sep 17 00:00:00 2001 From: Wesley Wong Date: Tue, 11 Oct 2016 15:10:35 -0700 Subject: [PATCH 2/4] Removes / and /api-docs from main.py. --- appengine/flexible/endpoints/main.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/appengine/flexible/endpoints/main.py b/appengine/flexible/endpoints/main.py index 86ba7ebfd37..ccfcc940a1c 100644 --- a/appengine/flexible/endpoints/main.py +++ b/appengine/flexible/endpoints/main.py @@ -25,26 +25,11 @@ from flask import Flask, jsonify, request, send_from_directory from flask_cors import cross_origin from six.moves import http_client -import yaml app = Flask(__name__) -@app.route('/', methods=['GET']) -def index(): - """Shows the index page.""" - return send_from_directory('.', 'index.html') - - -@app.route('/api-docs', methods=['GET']) -def swagger_json(): - """Serves up the Swagger spec for the API.""" - with open('swagger.yaml', 'r') as f: - spec = yaml.safe_load(f) - return jsonify(spec) - - @app.route('/echo', methods=['POST']) def echo(): """Simple echo service.""" From 1aa8c59be3df6ec8278be09e65571893215cb29d Mon Sep 17 00:00:00 2001 From: Wesley Wong Date: Tue, 11 Oct 2016 15:18:32 -0700 Subject: [PATCH 3/4] Remove unused import. --- appengine/flexible/endpoints/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine/flexible/endpoints/main.py b/appengine/flexible/endpoints/main.py index ccfcc940a1c..1e3d529edb0 100644 --- a/appengine/flexible/endpoints/main.py +++ b/appengine/flexible/endpoints/main.py @@ -22,7 +22,7 @@ import json import logging -from flask import Flask, jsonify, request, send_from_directory +from flask import Flask, jsonify, request from flask_cors import cross_origin from six.moves import http_client From 64e1ab424e65569055e6a36f554a3fcdc3ea56fa Mon Sep 17 00:00:00 2001 From: Wesley Wong Date: Tue, 11 Oct 2016 15:26:00 -0700 Subject: [PATCH 4/4] Remove tests for index and api docs. --- appengine/flexible/endpoints/main_test.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/appengine/flexible/endpoints/main_test.py b/appengine/flexible/endpoints/main_test.py index 2b9b4b66c42..6ca6b5093d3 100644 --- a/appengine/flexible/endpoints/main_test.py +++ b/appengine/flexible/endpoints/main_test.py @@ -29,16 +29,6 @@ def client(monkeypatch): return client -def test_index(client): - r = client.get('/') - assert r.status_code == 200 - - -def test_api_docs(client): - r = client.get('/api-docs') - assert r.status_code == 200 - - def test_echo(client): r = client.post( '/echo',