/restapp

This reporisitory is a sample webapp with easy to use configuration for jersey support

Primary LanguageJavaApache License 2.0Apache-2.0

RestApp

This project contains boiler plate code to write and experience JAX-RS web services.

How to Setup

  1. Clone the git repository
  2. Export JAVA_HOME environment variable and make it point to JDK
  3. Export GRADLE_HOME environment variable and make it point to a gradle installation.
  4. Add GRADLE_HOME/bin to PATH
  5. run gradle tomcatRunWar, this will build and deploy the webapp on a tomcat instance.
  6. hit http://localhost:8080/cms/rest/helloworld in the browser and be greeted with Hello World.

How to Add New Api

  1. Navigate to restapp/src/main/java/com/phodu/rest/api folder and write your class there.
  2. Modify restapp/src/main/resources/RestAppRegistry.properties to add the newly added class.
  3. Build the war and deploy by running the following command gradle tomcatRunWar.

Miscellaneous Info

  1. The generated war can be found in restapp/build/libs
  2. Eclipse projects can be generated by running "gradle eclipse"