I've been trying to use this otherwise simple routing constraint
Dispatch = cowboy_router:compile([{'_',
[
{"/tokens/:tokenid",{tokenid,int}, paytoken_handler, []}
]}]),
but i keep getting the same error.
My request is curl 10.10.10.56:8080/tokens/1000 -v -H "Content-Type: application/json"
[error] Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {function_clause,[{cowboy_router,check_constraints,[{tokenid,int},[{tokenid,<<"1000">>}]],[{file,"src/cowboy_router.erl"},{line,276}]},{cowboy_router,match_path,4,[{file,"src/cowboy_router.erl"},{line,264}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,172}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]}
NOTE: When i remove the constraint {tokenid, int} it works fine.
Dispatch = cowboy_router:compile([{'_',
[
{"/tokens/:tokenid", paytoken_handler, []}
]}]),
Any help please.
Thanks.