Web (JavaScript) Client Tutorial
Google Cloud Endpoints is a feature that enables developers to easily develop and host APIs on App Engine with OAuth 2.0 support. From this single API source, Endpoints also lets developers generate strongly-typed client libraries for Java (Android) and Objective-C (iOS), along with dynamically-typed libraries for JavaScript.
Purpose of the tutorial
This tutorial focuses only on building a web (JavaScript) client that uses the API provided by the API backend created in the API backend tutorial . You need to complete that backend tutorial first, because this client tutorial adds code to that backend project and requires that backend API to be running in order to successfully make requests against it.In this tutorial, you will learn how to:
- Create a simple HTML page that provides client UI to access the backend API.
- Create the JavaScript that is invoked by the client UI and does the actual work of accessing the backend.
- Deploy client app and API backend to production App Engine, then test the client.
- Use OAuth 2.0 in the client to gain access to an API backend method that is restricted to authorized clients.
Complete sample code location
The tutorial leads you through the addition of all the code required to run the sample. However, if you want to download the entire project, visit the code repository containing the appengine-endpoints-helloendpoints-java-maven project .
Topics covered
The following topics lead you through the tutorial:
- Setup .
- Adding the Client UI to invoke a simple GET and display results.
- Adding JavaScript for a simple GET.
- Adding a simple POST .
- Adding Auth support to the client to access a backend method Protected by OAuth.