Sitelet https://github.com/nginx-clojure/nginx-clojure/tree/master/example-projects/jersey-spring-example
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Jersey & Spring Example for Nginx-Clojure

This example project is used to demo how to use jersey, a JAX-RS Reference Implementation, and spring dependency injection with Nginx-Clojure

.

Run Unit Test

mvn test

Run Application

Get the source
git clone https://github.com/nginx-clojure/nginx-clojure
Package
cd nginx-clojure/example-projects/jersey-spring-example
## use mvn pakage to get jersey-spring-example-0.0.1-jar-with-dependencies.jar
mvn package
Download 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 nginx
Run Nginx-Clojure
./nginx
Add a student
curl  -H "Content-Type: application/json" -X POST -d '{"name":"Tom", "grade":"A"}'    http://localhost:8080/api/students
Find student by id
curl http://localhost:8080/api/students/1