https://github.com/http-kit/lein-template
A Leiningen 2.0 template for Clojure web programming (working in progress)
https://github.com/http-kit/lein-template
Last synced: 7 months ago
JSON representation
A Leiningen 2.0 template for Clojure web programming (working in progress)
- Host: GitHub
- URL: https://github.com/http-kit/lein-template
- Owner: http-kit
- Created: 2013-03-03T07:15:21.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-04-06T00:59:48.000Z (almost 10 years ago)
- Last Synced: 2024-05-09T12:09:31.276Z (almost 2 years ago)
- Language: Clojure
- Size: 142 KB
- Stars: 40
- Watchers: 6
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lein-template
A Leiningen 2.0 template for Clojure web programming (working in progress)
# How to install
Add the following to your `~/.lein/profiles.clj`
```clj
{:user {:plugins [
[http-kit/lein-template "1.0.0-SNAPSHOT"]
]}}
```
Use it:
```sh
lein new http-kit your.project.name
```
For example:
```sh
lein new http-kit clj_web && cd clj_web
=>
├── README.md
├── project.clj
├── public
│ ├── css
│ │ ├── bootstrap-responsive.css
│ │ ├── bootstrap.css
│ │ └── style.css
│ ├── img
│ │ ├── glyphicons-halflings-white.png
│ │ └── glyphicons-halflings.png
│ └── js
│ └── lib
│ ├── bootstrap.js
│ └── jquery-1.9.1.js
├── scripts
│ └── run
├── src
│ ├── clj_web
│ │ ├── config.clj
│ │ ├── handlers
│ │ │ ├── api.clj
│ │ │ └── app.clj
│ │ ├── main.clj
│ │ ├── middleware.clj
│ │ ├── routes.clj
│ │ └── tmpls.clj
│ ├── logback.xml
│ └── templates
│ ├── landing.tpl
│ └── partials
│ └── header.tpl
└── test
├── clj_web
│ ├── app_test.clj
│ └── test_common.clj
└── logback-test.xml
```
### Start the a server for local testing
```sh
./scripts/run
```
### Run unit test
```sh
lein test
```
### Template (Mustache)
Mustache is easy to learn. I've used it in severial projects, and quite happy with it.
files in src/templates, a Clojure function is created according to tempalte name, eg:
`landing.tpl` => `lein-template.tmpl/landing`
### Deploy
1. `lein uberjar` create a standalone executable jar file in the target directory
2. copy the jar and the `public` directory to your production server
3. ```sh
java -jar target/lein-template-standalone.jar --profile prod --port 8000
```
## License
Copyright © 2013 Feng Shen
Distributed under the Eclipse Public License, the same as Clojure.