.. index:: single: http_static_files .. _http_static_files/0: .. rst-class:: right **object** ``http_static_files`` ===================== Router-agnostic static file response helper built on the normalized ``http_core`` library. | **Availability:** | ``logtalk_load(http_static_files(loader))`` | **Author:** Paulo Moura | **Version:** 1:0:0 | **Date:** 2026-07-14 | **Compilation flags:** | ``static, context_switching_calls`` | **Imports:** | ``public`` :ref:`options ` | ``public`` :ref:`http_docroot_paths ` | **Uses:** | :ref:`atom ` | :ref:`date ` | :ref:`http_core ` | :ref:`http_cors ` | :ref:`http_directory_listing ` | :ref:`list ` | :ref:`mime_types ` | :ref:`os ` | :ref:`user ` | **Remarks:** | (none) | **Inherited public predicates:** |  :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`options_protocol/0::option/2`  :ref:`options_protocol/0::option/3`  :ref:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`   .. contents:: :local: :backlinks: top Public predicates ----------------- .. index:: serve/4 .. _http_static_files/0::serve/4: ``serve/4`` ^^^^^^^^^^^ Serves a relative request path from the given document root using the default options and returns a normalized response. | **Compilation flags:** | ``static`` | **Template:** | ``serve(Path,Request,DocumentRoot,Response)`` | **Mode and number of proofs:** | ``serve(+atom,+compound,+atom,-compound)`` - ``one_or_error`` | **Exceptions:** | ``Path`` is not a safe document-root relative path: | ``domain_error(http_docroot_relative_path,Path)`` | ``Request`` is not a valid normalized HTTP request term: | ``domain_error(http_request,Request)`` | ``DocumentRoot`` is not a valid absolute document root path: | ``domain_error(http_docroot_document_root,DocumentRoot)`` | ``DocumentRoot`` is not an existing static-files document root: | ``domain_error(http_static_files_document_root,DocumentRoot)`` | The generated response violates normalized HTTP response semantics: | ``domain_error(http_header_semantics,Header)`` ------------ .. index:: serve/5 .. _http_static_files/0::serve/5: ``serve/5`` ^^^^^^^^^^^ Serves a relative request path from the given document root using the given options and returns a normalized response. | **Compilation flags:** | ``static`` | **Template:** | ``serve(Path,Request,DocumentRoot,Options,Response)`` | **Mode and number of proofs:** | ``serve(+atom,+compound,+atom,+list(compound),-compound)`` - ``one_or_error`` | **Exceptions:** | ``Path`` is not a safe document-root relative path: | ``domain_error(http_docroot_relative_path,Path)`` | ``Request`` is not a valid normalized HTTP request term: | ``domain_error(http_request,Request)`` | ``DocumentRoot`` is not a valid absolute document root path: | ``domain_error(http_docroot_document_root,DocumentRoot)`` | ``DocumentRoot`` is not an existing static-files document root: | ``domain_error(http_static_files_document_root,DocumentRoot)`` | ``Options`` is a variable or a partial list: | ``instantiation_error`` | ``Options`` is neither a variable nor a list: | ``type_error(list,Options)`` | An element ``Option`` of the list ``Options`` is neither a variable nor a compound term: | ``type_error(compound,Option)`` | An element ``Option`` of the list ``Options`` is a compound term but not a valid option: | ``domain_error(option,Option)`` | The generated response violates normalized HTTP response semantics: | ``domain_error(http_header_semantics,Header)`` ------------ Protected predicates -------------------- (no local declarations; see entity ancestors if any) Private predicates ------------------ (no local declarations; see entity ancestors if any) Operators --------- (none)