aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/start.asciidoc
blob: 09720dca80dd54a7e6f996d284572ba782a3297f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[[start]]
== Starting and stopping

This chapter describes how to start and stop the Gun application.

=== Setting up

Specify Gun as a dependency to your application in your favorite
build tool.

With Erlang.mk this is done by adding `gun` to the `DEPS` variable
in your Makefile.

.Adding Gun as an Erlang.mk dependency
[source,make]
----
DEPS = gun
----

=== Starting

Gun is an _OTP application_. It needs to be started before you can
use it.

.Starting Gun in an Erlang shell
[source,erlang]
----
1> application:ensure_all_started(gun).
{ok,[crypto,cowlib,asn1,public_key,ssl,gun]}
----

=== Stopping

You can stop Gun using the `application:stop/1` function, however
only Gun will be stopped. This is the reverse of `application:start/1`.
The `application_ensure_all_started/1` function has no equivalent for
stopping all applications.

.Stopping Gun
[source,erlang]
----
application:stop(gun).
----