summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/1.1/guide/start.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-08-08 12:55:18 +0200
committerLoïc Hoguin <[email protected]>2018-08-08 12:55:18 +0200
commit87a857865a83c63412bb465a9a570a63f10af8f1 (patch)
treeaa0acd07626420d6cbf3551304b291b4900d5ce0 /docs/en/gun/1.1/guide/start.asciidoc
parenta63ee9b363aa7214343966690b50d77f4d3475e6 (diff)
downloadninenines.eu-87a857865a83c63412bb465a9a570a63f10af8f1.tar.gz
ninenines.eu-87a857865a83c63412bb465a9a570a63f10af8f1.tar.bz2
ninenines.eu-87a857865a83c63412bb465a9a570a63f10af8f1.zip
Gun 1.1
Diffstat (limited to 'docs/en/gun/1.1/guide/start.asciidoc')
-rw-r--r--docs/en/gun/1.1/guide/start.asciidoc43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/en/gun/1.1/guide/start.asciidoc b/docs/en/gun/1.1/guide/start.asciidoc
new file mode 100644
index 00000000..09720dca
--- /dev/null
+++ b/docs/en/gun/1.1/guide/start.asciidoc
@@ -0,0 +1,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).
+----