---
title: ResourceHandler
description: Serves static content from a directory.
component: pinggateway
version: 2026
page_id: pinggateway:reference:ResourceHandler
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/ResourceHandler.html
revdate: 2025-06-02T18:01:47Z
section_ids:
  ResourceHandler-usage: Usage
  ResourceHandler-properties: Properties
  ResourceHandler-example: Example
  ResourceHandler-moreinfo: More information
---

# ResourceHandler

Serves static content from a directory.

## Usage

```json
{
  "name": string,
  "type": "ResourceHandler",
  "config": {
    "directories": [ configuration expression<string>, ... ],
    "basePath": configuration expression<string>,
    "welcomePages": [ configuration expression<string>, ... ],
    "temporaryStorage": TemporaryStorage reference
  }
}
```

## Properties

* `"directories"`: *array of configuration expression<[strings](preface.html#definition-string)>, required*

  A list of one or more directories in which to search for static content.

  When multiple directories are specified in an array, the directories are searched in the listed order.

* `"basePath"`: \_configuration expression<[string](preface.html#definition-string)>, required if the route isn't `/`

  The base path of the incoming request for static content.

  To specify no base path, leave this property out of the configuration, or specify it as `"basePath": ""` or `"basePath": "/"`.

  Default: `""`.

* `"welcomePages"`: *array of configuration expression<[strings](preface.html#definition-string)>, optional*

  A set of static content to serve from one of the specified directories when no specific resource is requested.

  When multiple sets of static content are specified in an array, the sets are searched for in the listed order. The first set that is found is used.

  Default: Empty

* `"temporaryStorage"`: *TemporaryStorage [reference](preface.html#definition-reference), optional*

  A [TemporaryStorage](TemporaryStorage.html) object for the static content.

  Default: `TemporaryStorage` heap object

## Example

The following example serves requests to `https://ig.example.com:8443` with the static file `index.html` from `/path/to/static/pages/`:

```json
{
  "name": "StaticWebsite",
  "type": "ResourceHandler",
  "config": {
    "directories": ["/path/to/static/pages"],
    "welcomePages": ["index.html"]
  }
}
```

When the `basePath` is `/website`, the example serves requests to `https://ig.example.com:8443/website`:

```json
{
  "name": "StaticWebsite",
  "type": "ResourceHandler",
  "config": {
    "directories": ["/path/to/static/pages"],
    "basePath": "/website",
    "welcomePages": ["index.html"]
  }
}
```

## More information

[org.forgerock.openig.handler.resources.ResourceHandler](../_attachments/apidocs/org/forgerock/openig/handler/resources/ResourceHandler.html)

[org.forgerock.http.protocol.Entity](../_attachments/apidocs/org/forgerock/http/protocol/Entity.html)
