This example project is used to demo how to use jersey, a JAX-RS Reference Implementation, and spring dependency injection with Nginx-Clojure
.
Get the source
git clone https://github.com/nginx-clojure/nginx-clojurePackage
cd nginx-clojure/example-projects/jersey-spring-example
## use mvn pakage to get jersey-spring-example-0.0.1-jar-with-dependencies.jar
mvn packageDownload Nginx-Clojure
cd nginx-work-dir
mkdir logs temp
wget https://sourceforge.net/projects/nginx-clojure/files/nginx-clojure-0.5.1.tar.gz
tar -zxvf nginx-clojure-0.5.1.tar.gz nginx-clojure-0.5.1/nginx-linux-x64
mv nginx-clojure-0.5.1/nginx-linux-x64 nginxRun Nginx-Clojure
./nginxAdd a student
curl -H "Content-Type: application/json" -X POST -d '{"name":"Tom", "grade":"A"}' http://localhost:8080/api/studentsFind student by id
curl http://localhost:8080/api/students/1