mix davy.serve (davy v0.3.0)

Copy Markdown View Source

Starts a Bandit HTTP server routing to Davy.Plug and blocks until the process is terminated.

Useful for smoke testing a backend implementation against a real WebDAV client (macOS Finder, Windows Explorer, cadaver, davfs2, etc.) without wiring the plug into an application.

Usage

mix davy.serve [options]

With no options, serves Davy.Backend.InMemory on 127.0.0.1:4918.

Options

  • --backend Module — module implementing Davy.Backend (default: Davy.Backend.InMemory). The task calls start/0 on the backend if such a function exists, so Davy.Backend.InMemory is initialised automatically; other backends may need to be started externally before the task runs.

  • --port N — TCP port to listen on (default: 4918).

  • --ip ADDRESS — IP address to bind to. Accepts loopback (the default), any, or a dotted-quad like 0.0.0.0.

Examples

# Zero-config: in-memory backend on http://127.0.0.1:4918
mix davy.serve

# Serve on all interfaces, port 8080
mix davy.serve --ip any --port 8080

# Use a custom backend
mix davy.serve --backend MyApp.DavBackend