Skip to content

Commit e1e615c

Browse files
wmwongJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Merges the contents of index.html into the README for the Endpoints sample. (GoogleCloudPlatform#570)
Removes index.html and adds two new sections in the README for viewing the Endpoints graphs and Swagger UI.
1 parent 779f816 commit e1e615c

File tree

4 files changed

+14
-45
lines changed

4 files changed

+14
-45
lines changed

appengine/flexible/endpoints/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,16 @@ $ gcloud app deploy app.yaml --project=YOUR-CLIENT-PROJECT-ID
172172

173173
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
174174
the client's service account using Google ID token.
175+
176+
## Viewing the Endpoints graphs
177+
178+
By using Endpoints, you get access to several metrics that are displayed graphically in the Cloud Console.
179+
180+
To view the Endpoints graphs:
181+
182+
1. Go to the [Endpoints section in Cloud Console](https://console.cloud.google.com/endpoints) of the project you deployed your API to.
183+
2. Click on your API to view more detailed information about the metrics collected.
184+
185+
## Swagger UI
186+
187+
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/).

appengine/flexible/endpoints/index.html

-19
This file was deleted.

appengine/flexible/endpoints/main.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,14 @@
2222
import json
2323
import logging
2424

25-
from flask import Flask, jsonify, request, send_from_directory
25+
from flask import Flask, jsonify, request
2626
from flask_cors import cross_origin
2727
from six.moves import http_client
28-
import yaml
2928

3029

3130
app = Flask(__name__)
3231

3332

34-
@app.route('/', methods=['GET'])
35-
def index():
36-
"""Shows the index page."""
37-
return send_from_directory('.', 'index.html')
38-
39-
40-
@app.route('/api-docs', methods=['GET'])
41-
def swagger_json():
42-
"""Serves up the Swagger spec for the API."""
43-
with open('swagger.yaml', 'r') as f:
44-
spec = yaml.safe_load(f)
45-
return jsonify(spec)
46-
47-
4833
@app.route('/echo', methods=['POST'])
4934
def echo():
5035
"""Simple echo service."""

appengine/flexible/endpoints/main_test.py

-10
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ def client(monkeypatch):
2929
return client
3030

3131

32-
def test_index(client):
33-
r = client.get('/')
34-
assert r.status_code == 200
35-
36-
37-
def test_api_docs(client):
38-
r = client.get('/api-docs')
39-
assert r.status_code == 200
40-
41-
4232
def test_echo(client):
4333
r = client.post(
4434
'/echo',

0 commit comments

Comments
 (0)