vzdv_caddy_static_serve_and_log

package module
v0.0.0-...-6b61385 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2025 License: MIT Imports: 9 Imported by: 0

README

caddy_log_requests

A very simple Caddy extension built with xcaddy that logs requests made to a route to a local SQLite database.

Building

Requirements
Steps
  1. Run just
  2. Use the "caddy-custom" binary

Use

Include for a file_server directive, like:

:8000 {
        handle_path /assets/* {
                route {
                        serve_and_log * data.sqlite requests
                        root * ./assets
                        file_server
                }
        }

        handle {
                reverse_proxy :8001
        }
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	DbFile  string `json:"db_file"`
	DbTable string `json:"db_table"`
	// contains filtered or unexported fields
}

func (Middleware) CaddyModule

func (Middleware) CaddyModule() caddy.ModuleInfo

func (*Middleware) Cleanup

func (m *Middleware) Cleanup() error

func (*Middleware) Provision

func (m *Middleware) Provision(ctx caddy.Context) error

func (Middleware) ServeHTTP

func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

func (*Middleware) UnmarshalCaddyfile

func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

func (*Middleware) Validate

func (m *Middleware) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL