Common Lisp Package: CLACK.APP.DIRECTORY

# Clack.App.Directory - Server static files from document root with directory index. ## SYNOPSIS ;; mount /var/www/ to http://localhost:5000/ (clackup (make-instance '<clack-app-directory> :root #p"/var/www/") :port 5000) ;; same as above (clack.app.directory:start-server :root #p"/var/www/" :port 5000) ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com) ## SEE ALSO * Clack.App.File

README:

FUNCTION

Public

Undocumented

START-SERVER (&KEY (ROOT (TRUENAME .)) (PORT 5000))

Private

DIR-FILE (FILE &KEY URI NAME)

Stolen from rack/directory.rb.

DIR-PAGE (PATH-INFO BODY)

Stolen from rack/directory.rb.

DIRECTORY-EXISTS-P (PATHSPEC)

Checks whether the file named by the pathname designator PATHSPEC exists and if it is a directory. Returns its truename if this is the case, NIL otherwise. The truename is returned in directory form as if by PATHNAME-AS-DIRECTORY.

DIRECTORY-PATHNAME-P (PATHSPEC)

Returns NIL if PATHSPEC (a pathname designator) does not designate a directory, PATHSPEC otherwise. It is irrelevant whether file or directory designated by PATHSPEC does actually exist.

FILE-EXISTS-P (PATHSPEC)

Checks whether the file named by the pathname designator PATHSPEC exists and returns its truename if this is the case, NIL otherwise. The truename is returned in `canonical' form, i.e. the truename of a directory is returned as if by PATHNAME-AS-DIRECTORY.

FILE-SIZE (PATH)

Return the size of the file at `path'. If `path' is a directory, this will return nil.

LIST-DIRECTORY (DIRNAME &KEY (FOLLOW-SYMLINKS T))

Returns a fresh list of pathnames corresponding to all files within the directory named by the non-wild pathname designator DIRNAME. The pathnames of sub-directories are returned in directory form - see PATHNAME-AS-DIRECTORY. If FOLLOW-SYMLINKS is true, then the returned list contains truenames (symlinks will be resolved) which essentially means that it might also return files from *outside* the directory. This works on all platforms. When FOLLOW-SYMLINKS is NIL, it should return the actual directory contents, which might include symlinks. Currently this works on SBCL and CCL.

Undocumented

HTML-ENCODE (STR)

GENERIC-FUNCTION

Private

Undocumented

SERVE-PATH (THIS ENV FILE ENCODING)

SHOULD-HANDLE (THIS FILE)

CLASS

Public

Undocumented

<CLACK-APP-DIRECTORY>

Private

<CLACK-APP-FILE>

Clack Application to serve static files.