Deploying and testing an API

This page describes how to deploy your API.

Before you begin

Deploying an API

You can deploy your API using the App Engine Apache Maven or Gradle plugins. To deploy your API to a production App Engine standard environment, use the command for your plugin:

  1. Use the command for your plugin:


    mvn appengine:deploy


    gradle appengineDeploy
  2. Wait for the deployment to finish.
  3. Send a test request to your deployed API. For example, using curl:

    curl \
        -H "Content-Type: application/json" \
        -X POST \
        -d '{"message": "echo"}' \

    Your response is similar to the following:

      "message": "echo echo"

If you didn't get a successful response, see Troubleshooting response errors.

Deploying to multiple application versions

For information on how to do API versioning, and how to deploy to versions, see Handling API versioning

Running and testing API backends locally

To test your API locally:

  1. Build the project in the root directory of the project. For example:


    mvn clean package


    gradle clean build
  2. Start the App Engine development server. For example:


    mvn appengine:run


    gradle appengineRun
  3. Make an API request to test your API. For example, using curl:

    curl \
        -H "Content-Type: application/json" \
        -X POST \
        -d '{"message": "echo"}' \

Serving your API from a different path

To serve your API from a different path, in your web.xml file, change the url-pattern in the EndpointsServlet section and redeploy your API. For example:


Adding API management

Endpoints Frameworks provides API management features such as:

For your API to be managed by Endpoints Frameworks, you must generate and deploy an OpenAPI document that describes your API, as described in Adding API management.