Open oubiwann opened 3 years ago
Cowboy routes:
Dispatch = cowboy_router:compile([
%% {HostMatch, list({PathMatch, Handler, InitialState})}
{'_', [{'_', my_handler, #{}}]}
]),
%% Name, TransOpts, ProtoOpts
cowboy:start_clear(my_http_listener,
[{port, 8080}],
#{env => #{dispatch => Dispatch}}
).
Cowboy routes in LFE:
(defun routes ()
"Format: #(host-pattern (#(path-pattern handler state-0)))"
'(#(_ (#(_ my-handler #m()))))
(defun dispatch ()
(cowboy_router:compile (routes)))
(cowboy:start_clear 'my_http_listener
'(#(port 8080))
`#m(env #m(dispatch ,(dispatch))))
So I think ... really all that's needed is something to generate the routes
function / data structure above ...
Tasks:
Part of:
1