# Storage

Settings for accessing the available storage types. The storages are accessible via HTTP, mounted to different paths.

## Configuration

{% tabs %}
{% tab title="JSON" %}

```
{
   "storage": {
     "mimetypes_file": "./mime.types",
     "cors": {
         "origins": [
            "*"
         ]
     },
     "disk": {...},
     "memory": {...},
     "s3": []
   }
}
```

{% endtab %}

{% tab title="ENV" %}

```
CORE_STORAGE_MIMETYPES_FILE="./mime.types"
CORE_STORAGE_CORS_ORIGINS="*"
```

{% endtab %}
{% endtabs %}

### mimetypes\_file (string)

Path to a file with the mime-type definitions. This is a file with the MIME types has one MIME type per line followed by a list of file extensions (including the "."). Files served from the storages will have the matching mime-type associated to it.

Example:

```
text/plain  .txt
text/html   .htm .html
...
```

{% hint style="warning" %}
Relative paths are interpreted relative to where the datarhei Core binary is executed.
{% endhint %}

Default: ./mime.types

### cors.origins (array)

Define a list of allowed CORS origin for accessing the storages.

By default it contains the only element `*`, allowing access from anywhere.

### Disk

The disk storage is mounted at `/` via the HTTP server.

{% content-ref url="/pages/wx3HWVsk58e94o2BtSFy" %}
[Disk](/core/configuration/storage/disk.md)
{% endcontent-ref %}

### In-memory

The memory storage is mounted at `/memfs` via the HTTP server.

{% content-ref url="/pages/Mo6VZKMRXGhVuZEHSUIM" %}
[In-memory](/core/configuration/storage/in-memory.md)
{% endcontent-ref %}

### S3

The S3 storage is mounted at the configured path via the HTTP server.

{% content-ref url="/pages/mTke84b6JtQeiOVoK9sj" %}
[S3](/core/configuration/storage/s3.md)
{% endcontent-ref %}

{% hint style="info" %}
S3 storage is available as of version 16.12.0
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datarhei.com/core/configuration/storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
