summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl
diff options
context:
space:
mode:
Diffstat (limited to 'deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl')
-rw-r--r--deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl29
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl b/deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl
new file mode 100644
index 0000000000..d0e676fd60
--- /dev/null
+++ b/deps/rabbitmq_web_mqtt_examples/src/rabbit_web_mqtt_examples_app.erl
@@ -0,0 +1,29 @@
+%% This Source Code Form is subject to the terms of the Mozilla Public
+%% License, v. 2.0. If a copy of the MPL was not distributed with this
+%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
+%%
+%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved.
+%%
+
+-module(rabbit_web_mqtt_examples_app).
+
+-behaviour(application).
+-export([start/2,stop/1]).
+
+%% Dummy supervisor - see Ulf Wiger's comment at
+%% http://erlang.2086793.n4.nabble.com/initializing-library-applications-without-processes-td2094473.html
+-behaviour(supervisor).
+-export([init/1]).
+
+start(_Type, _StartArgs) ->
+ {ok, Listener} = application:get_env(rabbitmq_web_mqtt_examples, listener),
+ {ok, _} = rabbit_web_dispatch:register_static_context(
+ web_mqtt_examples, Listener, "web-mqtt-examples", ?MODULE,
+ "priv", "WEB-MQTT: examples"),
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+stop(_State) ->
+ rabbit_web_dispatch:unregister_context(web_mqtt_examples),
+ ok.
+
+init([]) -> {ok, {{one_for_one, 3, 10}, []}}.