Skip to content

Commit 3b43a8d

Browse files
committed
Add README
1 parent 5e18bdf commit 3b43a8d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Example web application
2+
3+
This is a very simple web application that shows how to set up a
4+
Clojerl project at this very early stages.
5+
6+
It uses the `rebar3_clojerl` plugin to compile and to bring up a REPL.
7+
8+
## Build
9+
10+
git clone https://github.com/clojerl/example-web-app
11+
cd example-web-app
12+
rebar3 clojerl compile
13+
14+
To start the REPL just run:
15+
16+
rebar3 clojerl repl
17+
===> Verifying dependencies...
18+
===> Compiling web-app
19+
Clojure 0.0.0-988.b107f25
20+
clje.user=>
21+
22+
Now we can start the `web-app` application:
23+
24+
clje.user=> (application/ensure_all_started.e :web-app)
25+
#erl[:ok #erl(:ranch :cowlib :cowboy :web-app)]
26+
clje.user=>
27+
28+
You should see a `Hello World!` when browsing to
29+
`http://localhost:8080`.
30+
31+
## Playing around in the REPL
32+
33+
Changing the message shown is as easy as redefining the `message` var
34+
in the `web-app.root` namespace.
35+
36+
clje.user=> (ns web-app.root)
37+
nil
38+
clje.user=> (def message "Hello Nurse!")
39+
#'web-app.root/message

0 commit comments

Comments
 (0)