Plug couch_epi using supervisor
diff --git a/src/couch_index.app.src b/src/couch_index.app.src
index 594589d..fd523b2 100644
--- a/src/couch_index.app.src
+++ b/src/couch_index.app.src
@@ -18,5 +18,6 @@
         couch_index_server
     ]},
     {registered, [couch_index_server]},
-    {applications, [kernel, stdlib]}
+    {applications, [kernel, stdlib, couch_epi]},
+    {mod, {couch_index_app, []}}
 ]}.
diff --git a/src/couch_index_app.erl b/src/couch_index_app.erl
new file mode 100644
index 0000000..bdf770c
--- /dev/null
+++ b/src/couch_index_app.erl
@@ -0,0 +1,21 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License.  You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_index_app).
+-behaviour(application).
+-export([start/2, stop/1]).
+
+start(_Type, StartArgs) ->
+    couch_index_sup:start_link(StartArgs).
+
+stop(_State) ->
+    ok.
diff --git a/src/couch_index_sup.erl b/src/couch_index_sup.erl
new file mode 100644
index 0000000..2d4f671
--- /dev/null
+++ b/src/couch_index_sup.erl
@@ -0,0 +1,24 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License.  You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_index_sup).
+-behaviour(supervisor).
+-export([init/1]).
+
+-export([start_link/1]).
+
+
+start_link(Args) ->
+    supervisor:start_link({local,?MODULE}, ?MODULE, Args).
+
+init([]) ->
+    {ok, {{one_for_one, 3, 10}, couch_epi:register_service(couch_index_epi, [])}}.