[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [storage](../README) / mountsFrom

# Function: mountsFrom()

> **mountsFrom**(`config`): `Mount`[]

Defined in: [packages/core/src/storage/StorageFilesMiddleware.ts:136](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/storage/StorageFilesMiddleware.ts#L136)

Build the mount list from a storage config, in longest-prefix-first order.

Also enforces the one rule that keeps the storage root private: a local disk
served *without* `signed` has to live inside the public directory. Checked
here because this runs at boot, so an unsafe config fails before the server
accepts a request rather than the first time someone guesses a path.

## Parameters

### config

[`StorageConfigShape`](../interfaces/StorageConfigShape)

## Returns

`Mount`[]

## Throws

[UnsafePublicMountError](../classes/UnsafePublicMountError)
