Closed etnt closed 1 year ago
In the first "hello world" example with the bandit webserver using websockets, I get the following crash:
** (EXIT from #PID<0.95.0>) shutdown: failed to start child: {Bandit, #Reference<0.1586837308.1872232450.204926>} ** (EXIT) an exception was raised: ** (RuntimeError) Unsupported keys(s) in top level config: [:options] (bandit 0.7.7) lib/bandit.ex:382: Bandit.validate_options/3 (bandit 0.7.7) lib/bandit.ex:280: Bandit.start_link/1 (stdlib 4.3) supervisor.erl:414: :supervisor.do_start_child_i/3 (stdlib 4.3) supervisor.erl:400: :supervisor.do_start_child/2 (stdlib 4.3) supervisor.erl:384: anonymous fn/3 in :supervisor.start_children/2 (stdlib 4.3) supervisor.erl:1250: :supervisor.children_map/4 (stdlib 4.3) supervisor.erl:350: :supervisor.init_children/2 (stdlib 4.3) gen_server.erl:851: :gen_server.init_it/2
The problem seem to be the way options is specified. By doing this change, the example seem to work:
-webserver = {Bandit, plug: Router, scheme: :http, options: [port: 4000]} +webserver = {Bandit, plug: Router, scheme: :http, port: 4000}
Good find! Any chance you want to send a PR with a fix? 😌
will do
Closed by #1147.
In the first "hello world" example with the bandit webserver using websockets, I get the following crash:
The problem seem to be the way options is specified. By doing this change, the example seem to work: