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
You will get a 200 response with the following data:
71
+
72
+
{
73
+
"message": "echo"
74
+
}
75
+
76
+
## Build with gradle
77
+
78
+
### Adding the project ID to the sample API code
79
+
80
+
0. Edit the file `build.gradle`.
81
+
82
+
0. For `def projectId = 'YOUR_PROJECT_ID'`, replace the value `YOUR_PROJECT_ID` with
83
+
your project ID.
84
+
85
+
0. Edit the file `src/main/java/com/example/echo/Echo.java
86
+
87
+
0. Replace the value `YOUR-PROJECT-ID` with your project ID.
88
+
89
+
0. Save your changes.
90
+
91
+
### Building the sample project
92
+
93
+
To build the project on unix-based systems:
94
+
95
+
./gradlew build
96
+
97
+
Note for windows user: Use `gradlew.bat` instead of `./gradlew`
98
+
99
+
<details>
100
+
<summary>more details</summary>
101
+
The project contains the standard java and war plugins and in addition to that it contains the following plugins:
102
+
[endpoints-framework-gradle-plugin](https://github.com/GoogleCloudPlatform/endpoints-framework-gradle-plugin"endpoints-framework-gradle-plugin") for the endpoint related tasks and
103
+
[appengine-gradle-plugin](https://github.com/GoogleCloudPlatform/app-gradle-plugin"appengine-gradle-plugin") for the appengine standard related tasks.
104
+
</details>
105
+
106
+
### Generating the openapi.json file
107
+
108
+
To generate the required configuration file `openapi.json`:
109
+
110
+
./gradlew endpointsOpenApiDocs
111
+
112
+
This results in a file in build/endpointsOpenApiDocs/openapi.json
113
+
114
+
### Deploying the sample API to App Engine
115
+
116
+
To deploy the sample API:
117
+
118
+
0. Invoke the `gcloud` command to deploy the API configuration file:
0. Deploy the API implementation code by invoking:
123
+
124
+
./gradlew appengineDeploy
125
+
126
+
The first time you upload a sample app, you may be prompted to authorize the
127
+
deployment. Follow the prompts: when you are presented with a browser window
128
+
containing a code, copy it to the terminal window.
129
+
130
+
<details>
131
+
<summary>ERROR: (gcloud.app.deploy) The current Google Cloud project [...] does not contain an App Engine application.</summary>
132
+
If you create a fresh cloud project that doesn't contain a appengine application you may receive this Error:
133
+
134
+
ERROR: (gcloud.app.deploy) The current Google Cloud project [...] does not contain an App Engine application. Use `gcloud app create` to initialize an App Engine application within the project.
135
+
136
+
In that case just execute `gcloud app create`, you will be asked to select a region and the app will be created. Then run gradle appengineDeploy again.
137
+
</details>
138
+
139
+
0. Wait for the upload to finish.
140
+
141
+
### Sending a request to the sample API
55
142
56
143
After you deploy the API and its configuration file, you can send requests
0 commit comments