elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.84k stars 582 forks source link

Fix code examples in README.md #1141

Closed IvanIvanoff closed 1 year ago

IvanIvanoff commented 1 year ago

Fixing a few issues in the examples in the README file.

  1. For Bandit :port is not a top-level config. I see that in Plug.Cowboy there is a comment We support :options for backwards compatibility, so maybe the intent is to migrate away from :options? But this is still not supported in Bandit, so copy-pasting the example in iex leads to errors at the moment.

  2. In the Plug.Cowboy example the Router module was missing.

  3. Fix an unused parameter in the init/1 function in the Bandit+websocket example.

josevalim commented 1 year ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: