This page describes the files that must be included in API in order to use Cloud Endpoints Frameworks for App Engine.

Your project must contain, at a minimum, the following files:


| File and Location | Description |
|---|---|
| `/src/main/java/<packagepath>/<your_api_class>.java` | The class file (or files, if you implement your API across multiple classes) containing your backend API. |
| `/src/main/webapp/WEB-INF/appengine-web.xml` | The web app deployment descriptor required for App Engine configuration. |
| `/src/main/webapp/WEB-INF/web.xml` | The standard Java web app deployment descriptor mapping URLs to servlets and other information. |

The contents of each of these required files is documented in the following
sections.

## The API class file

The required and optional contents of the class file (or files, if you use a
[multi-class API](https://docs.cloud.google.com/endpoints/docs/frameworks/java/multiclass.md.txt)) are fully described
in the topic [Endpoint Annotations](https://docs.cloud.google.com/endpoints/docs/frameworks/java/annotations.md.txt).

## appengine-web.xml

The `appengine-web.xml` file is used to define the App Engine standard
environment configuration when the API is deployed.
See [appengine-web.xml Reference](https://docs.cloud.google.com/appengine/docs/standard/java/config/appref)
for more information.

The bare minimum contents required for this file are as follows:

```xml
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <runtime>java8</runtime>
    <threadsafe>true</threadsafe>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
</appengine-web-app>
```

## web.xml

You use the `web.xml` file to configure the Endpoints servlet, which handles
incoming requests and forwards them to the backend service running on
App Engine. The Endpoints servlet is required for your API to be
[managed by Cloud Endpoints](https://docs.cloud.google.com/endpoints/docs/frameworks/java/adding-api-management.md.txt).

The bare minimum contents required for this file are as follows:

```xml
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <!-- Wrap the backend with Endpoints Frameworks v2. -->
    <servlet>
        <servlet-name>EndpointsServlet</servlet-name>
        <servlet-class>com.google.api.server.spi.EndpointsServlet</servlet-class>
        <init-param>
            <param-name>services</param-name>
            <param-value>com.example.skeleton.MyApi</param-value>
        </init-param>
    </servlet>
    <!-- Route API method requests to the backend. -->
    <servlet-mapping>
        <servlet-name>EndpointsServlet</servlet-name>
        <url-pattern>/_ah/api/*</url-pattern>
    </servlet-mapping>
</web-app>
```

> [!IMPORTANT]
> **Important:** The URL pattern specified in the `web.xml` file defines the URL base path for the API. Make sure the pattern ends with a wildcard, as in `/_ah/api/*`.

For more information about `web.xml`, see
[The Deployment Descriptor: web.xml](https://docs.cloud.google.com/appengine/docs/standard/java/config/webxml).