http.git.serve

http.git

serve(repos) -> handle, err

Build an http.server handler serving the given repositories read-only

repos maps URL prefixes to repository paths, e.g. { ["/lilush"] = "/srv/git/lilush.git" }. Each path must be a git directory (bare repository) or a worktree containing .git. URLs may carry an optional .git suffix (clone http://host/lilush.git works).

The returned function matches the http.server handler contract: handle(method, query, args, headers, body, ctx).