TsgcWebSocketHTTPServerProperties › DocumentRoot

DocumentRoot Proprietà

Directory servita dal server HTTP integrato per i file statici (HTML, JavaScript, CSS, immagini, ecc.).

Sintassi

property DocumentRoot: String read GetDocumentRoot write FDocumentRoot;

Valore predefinito

(stringa vuota)

Note

Impostare DocumentRoot sulla cartella locale contenente le risorse statiche che il server HTTP è autorizzato a servire. Quando un client richiede un percorso documento, il server concatena DocumentRoot con l'URI della richiesta e, se il file risultante esiste, lo restituisce direttamente senza attivare l'evento OnCommandGet. Lasciare la proprietà vuota per disabilitare il dispatch automatico dei file in modo che ogni richiesta venga gestita a livello di programmazione. Le barre finali o le barre rovesciate vengono rimosse automaticamente.

Esempio


oServer := TsgcWebSocketHTTPServer.Create(nil);
oServer.Port := 80;
oServer.DocumentRoot := 'c:\www';
oServer.Active := true;

Torna alle Proprietà