This could be featured a bit more prominently, but you can find an example of how to start things on the child_spec/1 function: Plug.Cowboy — Plug.Cowboy v2.7.5
Generally I’d however suggest skipping cowboy alltogether and use bandit as an elixir dev. It’s written in elixir and specifically for plug. Cowboys erlang documentation is basically useless for the use with plug, as it’s not written for plug. You need plug_cowboy to translate between plug and cowboy.
Ah thanks for clarification (and pointing me to bandit)! I took a deeper look at the Plug package and it turn’s out that the code I wondered about was mostly related to Plug and not Cowboy. The routing definitions for example.