## Index

### Functions

- collapseLeadingSlashes
- createHtmlDocument
- createNotFoundDirectoryListener
- createRedirectDirectoryListener
- serveStatic

## Functions

### Private collapseLeadingSlashes

- collapseLeadingSlashes(str: string): string

- - Defined in home/runner/work/opine/opine/src/middleware/serveStatic.ts:122

  Collapse all leading slashes into a single slash

  #### Parameters

  - ##### str: string

  #### Returns string

### Private createHtmlDocument

- createHtmlDocument(title: string, body: string): string

- - Defined in home/runner/work/opine/opine/src/middleware/serveStatic.ts:140

  Create a minimal HTML document.

  #### Parameters

  - ##### title: string

  - ##### body: string

  #### Returns string

### Private createNotFoundDirectoryListener

- createNotFoundDirectoryListener(_req: OpineRequest, res: OpineResponse, _path: string): Function

- - Defined in home/runner/work/opine/opine/src/middleware/serveStatic.ts:157

  Create a directory listener that just 404s.

  #### Parameters

  - ##### _req: OpineRequest

  - ##### res: OpineResponse

  - ##### _path: string

  #### Returns Function

### Private createRedirectDirectoryListener

- createRedirectDirectoryListener(req: OpineRequest, res: OpineResponse, path: string): Function

- - Defined in home/runner/work/opine/opine/src/middleware/serveStatic.ts:171

  Create a directory listener that performs a redirect.

  #### Parameters

  - ##### req: OpineRequest

  - ##### res: OpineResponse

  - ##### path: string

  #### Returns Function

### serveStatic

- serveStatic(root: string, options?: any): Handler

- - Defined in home/runner/work/opine/opine/src/middleware/serveStatic.ts:55

  Serve static files.

  #### Parameters

  - ##### root: string

  - ##### Default value options: any = {}

  #### Returns Handler

Generated using TypeDoc