defmodule MockHttpServer do use Application def start( _type, _args ) do ip = Application.get_env( :mock_http_server, :ip, { 127, 0, 0, 1 } ) port = Application.get_env( :mock_http_server, :port, 4444 ) children = [ { MockHttpServer.RegistrationService, [] }, { Bandit, plug: MockHttpServer.HttpServer, ip: ip, port: port } ] opts = [ strategy: :one_for_one, name: MockHttpServer.Supervisor ] Supervisor.start_link( children, opts ) end end