Skip to content

Commit 011650e

Browse files
authored
Merge pull request #88 from GoogleCloudPlatform/remove-index
Merges index.html with the README for the Endpoints sample.
2 parents 964f72e + ced729f commit 011650e

File tree

4 files changed

+13
-49
lines changed

4 files changed

+13
-49
lines changed

appengine/endpoints/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Run the application:
2222

2323
$ bundle exec ruby app.rb -p 8080
2424

25-
In your web browser, go to the following address: http://localhost:8080.
26-
2725
### Using the echo client
2826

2927
With the app running locally, you can execute the simple echo client using:
@@ -104,3 +102,16 @@ Now you can use the client ID to make requests to the API:
104102
--host https://YOUR-PROJECT-ID.appspot.com \
105103
--api_key YOUR-API-KEY \
106104
--client_secrets_file /path/to/client_secrets.json
105+
106+
## Viewing the Endpoints graphs
107+
108+
By using Endpoints, you get access to several metrics that are displayed graphically in the Cloud Console.
109+
110+
To view the Endpoints graphs:
111+
112+
1. Go to the [Endpoints section in Cloud Console](https://console.cloud.google.com/endpoints) of the project you deployed your API to.
113+
2. Click on your API to view more detailed information about the metrics collected.
114+
115+
## Swagger UI
116+
117+
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/endpoints/app.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,12 @@
1919

2020
require "base64"
2121
require "json"
22-
require "yaml"
2322
require "sinatra"
2423

2524
before do
2625
content_type :json
2726
end
2827

29-
# Shows the index page.
30-
get "/" do
31-
content_type :html
32-
send_file "index.html"
33-
end
34-
35-
# Serves up the Swagger spec for the API.
36-
get "/api-docs" do
37-
YAML.load_file("swagger.yaml").to_json
38-
end
39-
4028
# Simple echo service.
4129
post "/echo" do
4230
message = JSON.parse(request.body.read)["message"]

appengine/endpoints/index.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

appengine/endpoints/spec/endpoint_sample_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,6 @@
1313
@app.set :environment, :production
1414
end
1515

16-
it "GET / renders home page" do
17-
get "/"
18-
19-
expect(last_response.status).to eq 200
20-
expect(last_response.content_type).to eq "text/html;charset=utf-8"
21-
expect(last_response.body).to include "Endpoints Sample"
22-
end
23-
24-
it "GET /api-docs renders Swagger specification" do
25-
get "/api-docs"
26-
27-
expect(last_response.status).to eq 200
28-
expect(last_response.content_type).to eq "application/json"
29-
expect(last_response.body).to include '"title":"Endpoints Example"'
30-
end
31-
3216
it "POST /echo renders message from request body" do
3317
post "/echo", '{"message":"hello from test"}'
3418

0 commit comments

Comments
 (0)