Welcome to the Hello Web project. This project is for getting started with web development in Clojure. It uses Ring, Compojure, and Hiccup. The rest is up to you.
You will need Leiningen 1.7.0 or above installed.
Here is a listing of the important files and directories.
$ tree
.
├── project.clj
├── resources
│ └── public
│ └── css
│ └── screen.css
├── src
│ └── hello_web
│ ├── handler.clj
│ ├── repl.clj
│ ├── routes
│ │ └── home.clj
│ └── views
│ └── layout.clj
└── test
└── hello_web
└── test
└── handler.clj
File / Directory | Description |
---|---|
`resources/public/` | Static resources (HTML, CSS, and JavaScript) go here. |
`src/hello_web/handler.clj` | This file wires the web application together. |
`src/hello_web/routes/` | Routes map URL's received by the web application to functions that should be invoked to serve the request. Put your routes in this folder. See `routes/home.clj` for an example. |
`src/hello_web/views/` | HTML templates written in Hiccup live in this folder. See `views/layout.clj` as an example. |
To start a web server for the application, run:
lein ring server
This command should open a browser for you. If it doesn't, the web server should be listening at, http://localhost:3000/
To run the tests for the project, run:
lein test
Copyright © 2016 8th Light. Released under the MIT license.