Common Lisp Package: CLACK.APP.FILE

# Clack.App.File - Serve static files. ## SYNOPSIS ;; THIS IS JUST FOR EXAMPLE (clackup (<clack-app-file> :root #p"./static-files/")) ;; Then access 'http://localhost/jellyfish.jpg' through into local './static-files/jellyfish.jpg'. ;; If the file isn't found, 404 will be returned. ## DESCRIPTION Clack.App.File serves static files in local directory. This Application should be used in other Middleware or Application (ex. Clack.Middleware.Static). ## AUTHOR Eitarow Fukamachi (e.arrows@gmail.com) ## SEE ALSO * Clack.Middleware.Static

README:

FUNCTION

Private

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.

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.

MIME-TYPE (PATHSPEC)

Given a pathname designator PATHSPEC returns the MIME type (as a string) corresponding to the suffix of the file denoted by PATHSPEC (or NIL).

UNIVERSAL-TO-TIMESTAMP (UNIVERSAL &KEY (NSEC 0))

Returns a timestamp corresponding to the given universal time.

Undocumented

FORMAT-RFC1123-TIMESTRING (DESTINATION TIMESTAMP)

TEXT-FILE-P (CONTENT-TYPE)

GENERIC-FUNCTION

Public

Undocumented

LOCATE-FILE (THIS PATH ROOT)

SERVE-PATH (THIS ENV FILE ENCODING)

SHOULD-HANDLE (THIS FILE)

Private

SCAN (REGEX TARGET-STRING &KEY START END REAL-START-POS ((REAL-START-POS *REAL-START-POS*) NIL) (END (LENGTH TARGET-STRING)) (START 0))

Searches TARGET-STRING from START to END and tries to match REGEX. On success returns four values - the start of the match, the end of the match, and two arrays denoting the beginnings and ends of register matches. On failure returns NIL. REGEX can be a string which will be parsed according to Perl syntax, a parse tree, or a pre-compiled scanner created by CREATE-SCANNER. TARGET-STRING will be coerced to a simple string if it isn't one already. The REAL-START-POS parameter should be ignored - it exists only for internal purposes.

SLOT-ACCESSOR

Private

Undocumented

ENCODING (OBJECT)

SETFENCODING (NEW-VALUE OBJECT)

FILE (OBJECT)

SETFFILE (NEW-VALUE OBJECT)

ROOT (OBJECT)

SETFROOT (NEW-VALUE OBJECT)

VARIABLE

Private

Undocumented

RETURN-400

RETURN-403

RETURN-404

CLASS

Public

<CLACK-APP-FILE>

Clack Application to serve static files.