11# Hello World Google Cloud Endpoints for App Engine
22
33This 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 ] .
4+ [ Google Cloud Endpoints Frameworks] [ 3 ] to new
5+ [ Google Cloud Endpoints Frameworks for App Engine] [ 8 ] using a
6+ ** Discovery Document** . Additionally, this sample provides an example of using
7+ the new App Engine Maven and Gradle plugins for deploying your Google App Engine
8+ Standard applications.
9+
510This sample contains comments of how to use the prior Endpoints Frameworks as
611well. For clarity, the prior Endpoints Frameworks and the new Endpoints
712Frameworks are denoted as Endpoints Frameworks v1.0 and Endpoints Frameworks
@@ -22,10 +27,21 @@ process is explained [here][8] and a quickstart is provided [here][9].
2227- [ Google Cloud Endpoints Frameworks v1.0] [ 3 ]
2328
2429## Build and Deployment Plugins
30+ - [ Google App Engine Maven plugin] [ 14 ]
31+ - [ Google App Engine Gradle plugin] [ 15 ]
32+
33+ ## Discovery Document and Client Library Generation Plugins
2534- [ Google Cloud Endpoints Frameworks Maven Plugin] [ 10 ]
2635- [ Google Cloud Endpoints Frameworks Gradle Plugin] [ 11 ]
2736
2837## Setup
38+ 1 . Change ` YOUR-PROJECT-ID ` with your project id in the hostname parameter
39+ defined in either the Maven or Gradle build script. Hostname is used when a
40+ discovery document is generated.
41+
42+ - Maven - pom.xml
43+ - Gradle - build.gradle
44+
29451 . [ Optional] : User Authenticating with Google Accounts in Web Clients
3046
3147 1 . Update the ` WEB_CLIENT_ID ` in [ Constants.java] ( src/main/java/com/example/helloendpoints/Constants.java )
@@ -37,12 +53,16 @@ process is explained [here][8] and a quickstart is provided [here][9].
3753 have registered in the
3854 [ Credentials on Developers Console for OAuth 2.0 client IDs] [ 6 ] .
3955
40- 1 . [ Optional] : User Authenticating with Google Accounts in other Applications Types
56+ 1 . [ Optional] : User Authenticating with Google Accounts in other Applications
57+ Types
4158
42- - Inside [ Constants.java] ( src/main/java/com/example/helloendpoints/Constants.java ) you will find placeholders for Android
43- applications using Google Accounts client IDs registered in the
59+ - Inside [ Constants.java] ( src/main/java/com/example/helloendpoints/Constants.java )
60+ you will find placeholders for Android applications using Google Accounts
61+ client IDs registered in the
4462 [ Credentials on Developers Console for OAuth 2.0 client IDs] [ 6 ] .
4563
64+ - Note: iOS support should work but has not been fully tested.
65+
4666 - These client IDs are used when defining annotation for this sample API
4767 found in [ Greetings.java] ( src/main/java/com/example/helloendpoints/Greetings.java ) .
4868
@@ -65,61 +85,66 @@ process is explained [here][8] and a quickstart is provided [here][9].
6585
6686### Maven
6787
68- 1. Build a fresh binary by using:
69-
70- `mvn clean compile`
71-
72- 1. Run the application locally at [http://localhost:8080][5] by using:
88+ 1. Build and Run the application locally at [http://localhost:8080][5] by using:
7389
74- `mvn appengine:run`
90+ `mvn clean appengine:run`
7591
76921. Explore local server's API explorer by browsing to:
7793
7894 [http://localhost:8080/_ah/api/explorer][13]
7995
80- 1. Generate the client library located at `target/client-libs/helloworld-v1-java.zip`
81- by using:
96+ 1. Generate the discovery document located at
97+ `target/discovery-docs/helloworld-v1-rest.discovery` by using:
98+
99+ `mvn endpoints-framework:discoveryDocs`
100+
101+ 1. Generate the client library located at
102+ `target/client-libs/helloworld-v1-java.zip` by using:
82103
83104 `mvn endpoints-framework:clientLibs`
84105
85- 1. Deploy your application to Google App Engine by using:
106+ 1. Build and Deploy your application to Google App Engine by using:
86107
87- `mvn appengine:deploy`
108+ `mvn clean appengine:deploy`
88109
89110### Gradle
90111
91- 1. Build a fresh binary by using:
92-
93- `gradle clean compileJava`
112+ 1. Build and Run the application locally at [http://localhost:8080][5] by using:
94113
95- 1. Run the application locally at [http://localhost:8080][5] by using:
114+ `./gradlew clean appengineRun`
96115
97- `gradle appengineRun `
116+ Windows users: Use `gradlew.bat` instead of `./gradlew `
98117
991181. Explore local server's API explorer by browsing to:
100119
101120 [http://localhost:8080/_ah/api/explorer][13]
102121
103- 1. Generate the client library located at `build/endpointsClientLibs/helloworld-v1-java.zip`
104- by using:
122+ 1. Generate the discovery document located at
123+ `build/endpointsDiscoveryDocs/helloworld-v1-rest.discovery` by using:
105124
106- `gradle endpointsClientLibs `
125+ `./gradlew endpointsDiscoveryDocs `
107126
108- 1. Deploy your application to Google App Engine by using:
127+ 1. Generate the client library located at
128+ `build/endpointsClientLibs/helloworld-v1-java.zip` by using:
129+
130+ `./gradlew endpointsClientLibs`
109131
110- `gradle appengineDeploy`
132+ 1. Deploy your application to Google App Engine by using:
111133
134+ `./gradlew appengineDeploy`
112135
113136[1]: https://cloud.google.com/appengine/docs/java/
114137[2]: http://java.com/en/
115- [3]: https://cloud.google.com/appengine /docs/java/endpoints/
138+ [3]: https://cloud.google.com/endpoints /docs/frameworks/legacy/v1/java
116139[4]: https://cloud.google.com/appengine/docs/java/tools/maven
117140[5]: http://localhost:8080/
118141[6]: https://console.developers.google.com/project/_/apiui/credential
119- [7]: https://cloud.google.com/appengine /docs/java/endpoints /migrating
142+ [7]: https://cloud.google.com/endpoints /docs/frameworks/legacy/v1/java /migrating
120143[8]: https://cloud.google.com/endpoints/docs/frameworks/java/about-cloud-endpoints-frameworks
121144[9]: https://cloud.google.com/endpoints/docs/frameworks/java/quickstart-frameworks-java
122145[10]: https://github.com/GoogleCloudPlatform/endpoints-framework-maven-plugin
123146[11]: https://github.com/GoogleCloudPlatform/endpoints-framework-gradle-plugin
124147[12]: https://cloud.google.com/endpoints/docs/authenticating-users-frameworks
125148[13]: http://localhost:8080/_ah/api/explorer
149+ [14]: https://github.com/GoogleCloudPlatform/app-maven-plugin
150+ [15]: https://github.com/GoogleCloudPlatform/app-gradle-plugin
0 commit comments