Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 1.35 KB

README.md

File metadata and controls

82 lines (52 loc) · 1.35 KB

Pedestal Sample Project

Build Status

Project Setup

brew install leiningen

Create a profiles.clj in the root of the project and add custom overrides

{ :profiles/dev { :jvm-opts ["-Dhttp.port=8080"] }}

Quick Start

$ lein run

$ curl localhost:4000/ruok
;;=> imok%

Dev

Clojure Reload Workflow

lein repl

;; start application
user=> (go)

;; refesh code
user=> (reset)

;; run tests
user=> (test)

Deployable

lein uberjar

$ java -cp target/sample-web-*-standalone.jar -Dhttp.port=8080 sample.app

$ curl localhost:8080/ruok

Examples

$ curl localhost:4000/ruok
imok%

$ curl localhost:4000/store/get/foo
bar%

$ curl localhost:4000/store/get/foo1
key not found foo1%

$ curl -X POST localhost:4000/store/put/foo1 -d '{"foo1": "42"}'
 json object posted %

$ curl -X POST -H "Content-type: application/json" localhost:4000/store/put/foo1 -d '{"foo1": "42"}'
ok%

$ curl localhost:4000/store/get/foo1
{:foo1 "42"}%

Documentation:

12factor.net
Pedestal
Component