AssetServerOptions

AssetServerOptions

AssetServerOptions

The configuration options for the AssetServerPlugin.

Signature

interface AssetServerOptions {
  hostname?: string;
  port: number;
  route: string;
  assetUploadDir: string;
  assetUrlPrefix?: string;
  previewMaxWidth?: number;
  previewMaxHeight?: number;
  presets?: ImageTransformPreset[];
}

Members

hostname

property
type:
string

port

property
type:
number
The local port that the server will run on. Note that the AssetServerPlugin includes a proxy server which allows the asset server to be accessed on the same port as the main Vendure server.

route

property
type:
string
The proxy route to the asset server.

assetUploadDir

property
type:
string
The local directory to which assets will be uploaded.

assetUrlPrefix

property
type:
string

The complete URL prefix of the asset files. For example, “https://demo.vendure.io/assets/"

If not provided, the plugin will attempt to guess based off the incoming request and the configured route. However, in all but the simplest cases, this guess may not yield correct results.

previewMaxWidth

property
type:
number
default:
1600
The max width in pixels of a generated preview image.

previewMaxHeight

property
type:
number
default:
1600
The max height in pixels of a generated preview image.

presets

property
An array of additional ImageTransformPreset objects.