From a62cc4260fd071d522d962ea0a302f6f995152aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 15 Jan 2016 11:22:22 +0100 Subject: Fix getting started for new Erlang.mk --- doc/src/guide/getting_started.ezdoc | 39 ++++--------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/doc/src/guide/getting_started.ezdoc b/doc/src/guide/getting_started.ezdoc index f0a701d..c775135 100644 --- a/doc/src/guide/getting_started.ezdoc +++ b/doc/src/guide/getting_started.ezdoc @@ -44,11 +44,7 @@ necessary for creating the release. We can already build and start this release. ``` bash -$ make -... -$ ./_rel/hello_erlang_release/bin/hello_erlang_release console -... -(hello_erlang@127.0.0.1)1> +$ make run ``` Entering the command `i().` will show the running processes, including @@ -74,34 +70,7 @@ DEPS = cowboy include erlang.mk ``` -Modifying the application resource file, `src/hello_erlang.app.src`, -allows the build system to know it needs to include Cowboy in the -release and start it automatically. This is a different step because -some dependencies are only needed during development. - -We are simply going to add `cowboy` to the list of `applications`, -right after `stdlib`. Don't forget the comma separator. - -``` erlang -{application, hello_erlang, [ - {description, "Hello Erlang!"}, - {vsn, "0.1.0"}, - {modules, []}, - {registered, []}, - {applications, [ - kernel, - stdlib, - cowboy - ]}, - {mod, {hello_erlang_app, []}}, - {env, []} -]}. -``` - -You may want to set a description for the application while you -are editing the file. - -If you run `make` now and start the release, Cowboy will be included +If you run `make run` now, Cowboy will be included in the release and started automatically. This is not enough however, as Cowboy doesn't do anything by default. We still need to tell Cowboy to listen for connections. @@ -132,7 +101,7 @@ The dispatch list is explained in great details in the path `/` to the handler module `hello_handler`. This module doesn't exist yet, we still have to write it. -If you build the release, start it and open ^http://localhost:8080 +If you build and run the release, then open ^http://localhost:8080 now, you will get an error because the module is missing. Any other URL, like ^http://localhost:8080/test^, will result in a 404 error. @@ -165,5 +134,5 @@ What the above code does is send a `200 OK` reply, with the `content-type` header set to `text/plain` and the response body set to `Hello Erlang!`. -If you build the release, start it and open ^http://localhost:8080 +If you build and run the release, then open ^http://localhost:8080 in your browser, you should get a nice `Hello Erlang!` displayed! -- cgit v1.2.3