vibe.d beta banner
get vibe.d
0.7.30

Function serveStaticFile

Returns a request handler that serves a specific file on disk.

See sendFile for more information.

Prototypes

void delegate(scope HTTPServerRequest, scope HTTPServerResponse) serveStaticFile(
  Path local_path,
  HTTPFileServerSettings settings = null
);

void delegate(scope HTTPServerRequest, scope HTTPServerResponse) serveStaticFile(
  string local_path,
  HTTPFileServerSettings settings = null
);

Parameters

NameDescription
local_path Path to the file to serve.
settings Optional settings object enabling customization of how the file gets served.

Returns

A request delegate is returned, which is suitable for registering in a URLRouter or for passing to listenHTTP.

See Also

serveStaticFiles, sendFile

Authors

Sönke Ludwig

Copyright

© 2012-2015 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.