~fancycade/nine_cowboy

Cowboy backend for nine router compiler
Update README and add util functions
Add doc to gitignore

clone

read-only
https://git.sr.ht/~fancycade/nine_cowboy
read/write
git@git.sr.ht:~fancycade/nine_cowboy

You can also use your local clone with git send-email.

#nine_cowboy

A cowboy backend for the 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