serve_from_file


Description:


[ Version ( since = "0.3" ) ]
public HandlerCallback serve_from_file (File root, ServeFlags serve_flags = NONE, ForwardCallback<File> forward = forward)

Serve static files relative to a given root.

The path to relative to the root is expected to be associated to the 'path' key in the routing context.

The path can be local or remote given that GVFS can be used.

The 'ETag' header is obtained from GLib.FileAttribute.ETAG_VALUE.

If the file is not found, the request is delegated to the next middleware.

If the file is not readable, a '403 Forbidden' is raised.

Parameters:

root

path from which resources are resolved

serve_flags

flags for serving the resources


Namespace: Valum.Static
Package: valum-0.3



2022 vala-language.org