Module stick/middleware/static

Middleware for serving static resources.

This installs a static() method in the application that accepts the following arguments:

  • base: the base resource directory (required)

  • index: the name of a file to serve if the path matches a directory (e.g. "index.html")

  • baseURI: a common prefix for a resource URI (e.g. "/static")

You can call static() multiple times to register multiple resources to be served.

Functions


middleware (next, app)

Middleware for serving static resources.

Parameters

Function next the wrapped middleware chain
Object app the Stick Application object

Returns

Function a JSGI middleware function