Documentation Language: Swift

Initializer

init(rootDirectory:port:)

Creates a new preview server.

init(rootDirectory: URL, port: Int = 8080)

Parameters

rootDirectory

The directory containing documentation files to serve. Should be an absolute path.

port

The TCP port to bind to (default: 8080). Must be in the range 1-65535, and not already in use.

Example

let server = PreviewServer(
    rootDirectory: URL(fileURLWithPath: ".build/documentation"),
    port: 8080
)