Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1e615c

Browse filesBrowse files
wmwongJon Wayne Parrott
authored andcommitted
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
Copy full SHA for e1e615c

File tree

Expand file treeCollapse file tree

4 files changed

+14
-45
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+14
-45
lines changed

‎appengine/flexible/endpoints/README.md

Copy file name to clipboardExpand all lines: appengine/flexible/endpoints/README.md
+13Lines changed: 13 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: appengine/flexible/endpoints/index.html
-19Lines changed: 0 additions & 19 deletions
This file was deleted.

‎appengine/flexible/endpoints/main.py

Copy file name to clipboardExpand all lines: appengine/flexible/endpoints/main.py
+1-16Lines changed: 1 addition & 16 deletions
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

Copy file name to clipboardExpand all lines: appengine/flexible/endpoints/main_test.py
-10Lines changed: 0 additions & 10 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.