README.md

# nine_cowboy

A cowboy backend for the [nine](https://git.sr.ht/~fancycade/nine) router compiler library.

`nine_cowboy` additionally provides common middleware and utility functions.

## Build

    rebar3 compile

## Example

    cd example
    ./setup.sh
    rebar3 shell

Navigate to localhost:8080.

## Usage

Configure the cowboy server with the routes generated by nine like this:

    nine:compile(#{
        routes => ExampleRoutes,
        generator => nine_cowboy,
        router => example_router
    }),
    {ok, _} = cowboy:start_clear(example_http_lister,
        [{port, 8080}],
        #{middlewars => [example_router]}
    ).

Typically this goes in your application's `start/2` function.

## License

Apache V2