Skip to content

clojerl/example-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example web application

This is a very basic web application that shows how to set up a Clojerl project at this very early stage.

It uses the rebar3_clojerl plugin to compile and to bring up a REPL.

Quickstart with Docker Compose

docker-compose up

This will start the application on port 8080. To use the REPL, use docker-compose run.

docker-compose run --rm server rebar3 clojerl repl

Build

git clone https://github.com/clojerl/example-web-app
cd example-web-app
rebar3 clojerl compile

To start the REPL, run:

rebar3 clojerl repl
===> Verifying dependencies...
===> Compiling web-app
Clojure 0.0.0-988.b107f25
clje.user=>

Now we can start the web-app application:

clje.user=> (application/ensure_all_started :web-app)
#erl[:ok #erl(:ranch :cowlib :cowboy :web-app)]
clje.user=>

You should see a Hello World! when browsing to http://localhost:8080.

Playing around in the REPL

Changing the message shown can be done by redefining the message var in the web-app.root namespace.

clje.user=> (ns web-app.root)
nil
web-app.root=> (def message "Hello Universe!")
#'web-app.root/message

About

Very simple web application using cowboy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published