Table of Contents

TSparkleStaticServer Class

Server component that serves static files from a directory in the local file system.

Remarks

TSparkleStaticServer creates a TStaticModule listening at BaseUrl and serving the files under RootDir. Connect the component to a dispatcher component through the Dispatcher property, and use the OnModuleCreate event to further configure the created module, for example to change its index files or its folder URL mode.

Syntax

Unit: Sparkle.Comp.StaticServer

TSparkleStaticServer = class(TSparkleServer);

Properties

Name Description
BaseUrl Gets or sets the base URL the static module listens at.
Dispatcher Gets or sets the dispatcher component that serves this server component.
RootDir Gets or sets the root directory in the file system from which static files are served.

Events

Name Description
OnModuleCreate Event fired after the static module is created, allowing further customization of the module.