Creates an HTTP handler that serves files from a directory tree. NNG handles MIME type detection automatically.
Value
A handler object for use with http_server().
Details
Directory handlers automatically match all paths under the prefix (prefix matching is implicit). The URI path is mapped to the filesystem:
Request to "/static/css/style.css" serves "directory/css/style.css"
Request to "/static/" serves "directory/index.html" if it exists
Note: The trailing slash behavior depends on how clients make requests.
A request to "/static" (no trailing slash) will not automatically redirect
to "/static/". Consider using handler_redirect() if you need this behavior.
