Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merges the contents of index.html into the README for the Endpoints sample. #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions appengine/flexible/endpoints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
19 changes: 0 additions & 19 deletions appengine/flexible/endpoints/index.html

This file was deleted.

17 changes: 1 addition & 16 deletions appengine/flexible/endpoints/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,14 @@
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
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."""
Expand Down
10 changes: 0 additions & 10 deletions appengine/flexible/endpoints/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down