You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Hello World Google Cloud Endpoints for App Engine with a discovery document
1
+
# Hello World Google Cloud Endpoints for App Engine
2
2
3
3
This sample provides an example of a [migration][7] from the prior version of
4
-
[Google Cloud Endpoints Frameworks][3] to new [Google Cloud Endpoints Frameworks for App Engine][8]
5
-
while still using a discovery document. This sample contains comments of how to
6
-
use the prior Endpoints Frameworks as well. For clarity, the prior Endpoints
7
-
Frameworks and the new Endpoints Frameworks are denoted as Endpoints Frameworks v1.0
8
-
and Endpoints Frameworks v2.0 respectively.
4
+
[Google Cloud Endpoints Frameworks][3] to new [Google Cloud Endpoints Frameworks for App Engine][8].
5
+
This sample contains comments of how to use the prior Endpoints Frameworks as
6
+
well. For clarity, the prior Endpoints Frameworks and the new Endpoints
7
+
Frameworks are denoted as Endpoints Frameworks v1.0 and Endpoints Frameworks
8
+
v2.0, respectively.
9
9
10
10
Google Cloud Endpoints Frameworks v2.0 provides new functionality which may
11
-
require payment and uses an OpenAPI specification instead of the discovery document.
12
-
The OpenAPI development process is explained [here][8] and a quickstart is
13
-
provided [here][9].
11
+
require payment and uses an OpenAPI specification. The OpenAPI development
12
+
process is explained [here][8] and a quickstart is provided [here][9].
14
13
15
14
## Products
16
15
-[Google App Engine Standard][1]
@@ -30,23 +29,27 @@ provided [here][9].
30
29
1.[Optional]: User Authenticating with Google Accounts in Web Clients
31
30
32
31
1. Update the `WEB_CLIENT_ID` in [Constants.java](src/main/java/com/example/helloendpoints/Constants.java)
33
-
to reflect the web client ID you have registered in the [Credentials on Developers Console for OAuth 2.0 client IDs][6].
32
+
to reflect the web client ID you have registered in the
33
+
[Credentials on Developers Console for OAuth 2.0 client IDs][6].
34
34
35
-
1. Update the value of `google.devrel.samples.helloendpoints.CLIENT_ID` in [base.js](src/main/webapp/js/base.js)
36
-
to reflect the web client ID you have registered in the [Credentials on Developers Console for OAuth 2.0 client IDs][6].
35
+
1. Update the value of `google.devrel.samples.helloendpoints.CLIENT_ID` in
36
+
[base.js](src/main/webapp/js/base.js) to reflect the web client ID you
37
+
have registered in the
38
+
[Credentials on Developers Console for OAuth 2.0 client IDs][6].
37
39
38
40
1.[Optional]: User Authenticating with Google Accounts in other Applications Types
39
41
40
42
- Inside [Constants.java](src/main/java/com/example/helloendpoints/Constants.java) you will find placeholders for Android
41
-
and iOS applications using Google Accounts client IDs registered in the
43
+
applications using Google Accounts client IDs registered in the
42
44
[Credentials on Developers Console for OAuth 2.0 client IDs][6].
43
45
44
-
- These client IDs are used when defining annotation for this sample API found in [Greetings.java](src/main/java/com/example/helloendpoints/Greetings.java).
46
+
- These client IDs are used when defining annotation for this sample API
47
+
found in [Greetings.java](src/main/java/com/example/helloendpoints/Greetings.java).
45
48
46
49
- You can read more about different user authentication supported [here][12].
47
50
48
51
49
-
1.[Optional]: Use Cloud Endpoints Frameworks v2.0 Maven and Gradle discovery and
52
+
1.[Optional]: Use Cloud Endpoints Frameworks v2.0 Maven and Gradle
50
53
client library generation plugins with Cloud Endpoints Frameworks v1.0.
51
54
52
55
- Uncomment `Endpoints Frameworks v1.0` sections and comment
@@ -62,57 +65,61 @@ provided [here][9].
62
65
63
66
### Maven
64
67
65
-
1. Build a fresh binary with
68
+
1. Build a fresh binary by using:
66
69
67
70
`mvn clean compile`
68
71
69
-
1. Run the application locally at [localhost:8080][5] with
72
+
1. Run the application locally at [http://localhost:8080][5] by using:
70
73
71
74
`mvn appengine:run`
72
75
73
-
1. Generate the client library in a zip file named `helloworld-v1-java.zip` with
76
+
1. Explore local server's API explorer by browsing to:
77
+
78
+
[http://localhost:8080/_ah/api/explorer][13]
79
+
80
+
1. Generate the client library located at `target/client-libs/helloworld-v1-java.zip`
81
+
by using:
74
82
75
83
`mvn endpoints-framework:clientLibs`
76
84
77
-
1. Deploy your application to Google App Engine with
85
+
1. Deploy your application to Google App Engine by using:
78
86
79
87
`mvn appengine:deploy`
80
88
81
89
### Gradle
82
90
83
-
1. Build a fresh binary with
91
+
1. Build a fresh binary by using:
84
92
85
93
`gradle clean compileJava`
86
94
87
-
1. Run the application locally at [localhost:8080][5] with
95
+
1. Run the application locally at [http://localhost:8080][5] by using:
88
96
89
97
`gradle appengineRun`
90
98
91
-
1. Generate the client library in a zip file named `helloworld-v1-java.zip` with
99
+
1. Explore local server's API explorer by browsing to:
92
100
93
-
`gradle endpointsClientLibs`
101
+
[http://localhost:8080/_ah/api/explorer][13]
94
102
95
-
1. Deploy your application to Google App Engine with
103
+
1. Generate the client library located at `build/endpointsClientLibs/helloworld-v1-java.zip`
104
+
by using:
96
105
97
-
`gradle appengineDeploy`
106
+
`gradle endpointsClientLibs`
98
107
99
-
## Known issues
108
+
1. Deploy your application to Google App Engine by using:
100
109
101
-
There's a [bug][13] where `<version>1</version>` is required in the
102
-
[appengine-web.xml](src/main/webapp/WEB-INF/appengine-web.xml) to run
103
-
this sample locally. This will become optional in the near future.
Copy file name to clipboardExpand all lines: appengine/endpoints-frameworks-v2/migration-example/src/main/java/com/example/helloendpoints/Constants.java
-1
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,6 @@
22
22
publicclassConstants {
23
23
publicstaticfinalStringWEB_CLIENT_ID = "replace this with your web client ID";
24
24
publicstaticfinalStringANDROID_CLIENT_ID = "replace this with your Android client ID";
25
-
publicstaticfinalStringIOS_CLIENT_ID = "replace this with your iOS client ID";
Copy file name to clipboardExpand all lines: appengine/endpoints-frameworks-v2/migration-example/src/main/java/com/example/helloendpoints/Greetings.java
0 commit comments