Skip to content

Commit c022b16

Browse files
saicheemsJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Add basic README for endpoints v2 sample (#460)
1 parent 41f5c2b commit c022b16

File tree

1 file changed

+41
-0
lines changed
  • appengine/standard/endpoints-frameworks-v2/backend

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Endpoints Frameworks v2 Python Sample
2+
3+
This demonstrates how to use Google Cloud Endpoints Frameworks v2 on Google App Engine Standard Environment using Python.
4+
5+
This sample consists of two parts:
6+
7+
1. The backend
8+
2. The clients
9+
10+
## Running Locally
11+
12+
For more info on running Standard applications locally, see [the getting started documentation](https://cloud.google.com/appengine/docs/python/quickstart).
13+
14+
Create a `lib` directory in which to install the Endpoints Frameworks v2 library. For more info, see [Installing a library](https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library).
15+
16+
Install the Endpoints Frameworks v2 library:
17+
18+
$ mkdir lib
19+
$ pip install -t lib google-endpoints
20+
21+
Run the application:
22+
23+
$ dev_appserver.py app.yaml
24+
25+
In your web browser, go to the following address: http://localhost:8080/\_ah/api/explorer
26+
27+
## Deploying to Google App Engine
28+
29+
Generate a swagger file by running: `endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com`
30+
31+
To set up OAuth2, replace `your-oauth-client-id.com` under the `x-security` section in `echo-v1_swagger.json` with your OAuth2 client ID. If you want to use Google OAuth2 Playground, use `407408718192.apps.googleusercontent.com` as your audience. To generate a JWT, go to the following address: `https://developers.google.com/oauthplayground`.
32+
33+
Deploy the generated swagger spec to Google Cloud Service Management: `gcloud alpha service-management deploy echo-v1_swagger.json`
34+
35+
Open the `app.yaml` file and in the `env_variables` section, replace `your-service.appspot.com` with your service name, and `2016-08-01r0` with your uploaded service management configuration.
36+
37+
Then, deploy the sample using `gcloud`:
38+
39+
$ gcloud beta app deploy
40+
41+
Once deployed, you can access the application at https://your-service.appspot.com

0 commit comments

Comments
 (0)