The plug lesson uses outdate plug and cowboy versions:
[
{:cowboy, "~> 1.1.2"},
{:plug, "~> 1.3.4"}
]
Cowboy is now at 2.50 and Plug is at 1.7.1. Two changes I'd like to see:
plug_cowboyPlug.Adapters.Cowboy, it is recommended to use plug_cowboy's Plug.CowboyFrom the Plug 1.7 docs:
Plug.Adapters.Cowboy
This module is deprecated. To use Cowboy 1 With Plug please includeplug_cowboyversion 1.0 or above in yourmix.exsfile. It is recommended that you use thePlug.Cowboymodule directly instead ofPlug.Adapters.Cowboy.
So this:
children = [
Plug.Adapters.Cowboy.child_spec(:http, Example.Router, [], port: port)
]
Becomes this:
children = [
{Plug.Cowboy, scheme: :http, plug: Example.Router, options: [port: port]}
]
Howdy @SophieDeBenedetto! Good catch. I'd be happy to make this change and take a peek at whether the lesson needs any additional updates or you can take a stab at it — your call!
Hey @doomspork, I'm down to take a stab at it. I should have something for you guys in the next few days 🚀
You're awesome — thank you @SophieDeBenedetto!
Most helpful comment
Hey @doomspork, I'm down to take a stab at it. I should have something for you guys in the next few days 🚀