Giter Club home page Giter Club logo

rest's Introduction

REST API for CRUD operation,using the jersey,spring,hibernate,MySQL and maven.

Motivation for this project is to provide the head start to beginners to build REST API's,using the popular java open source frameworks and necessary configs.They should be able to build and test first webservice within 10 minutes.

Prerequisities

JDK :- 1.7
Mysql:- 5.6
Maven:-3.0 or later Tomcat:- 1.7 or later

Installing

1.Clone the project.
2.If maven is setup properly in your system. then you can download all the required dependency and build war using the maven by using below command.

mvn clean package

3.Create DB by running below command.

mysql -h hostname -u user database < path/to/test.sql

4.Change the username and password to your mysql username in context.xml.
5.Go to the target folder and copy the rest.war file and put it in tomcat webapps folder and start the server.

API Documentation.

To test the REST API , use any rest client like postman etc.
1.Create product api (sample)
URL :- localhost:8080/rest/api/products/
header :- content-type :- application/json
method :- post
body :- {
"name" : "first product",
"description" : "sample"
}
After hitting this api , new product must be created inside the rest database's product table. you can check this by firing the sql query on mysql terminal.
2.Get product api (sample)
URL :- localhost:8080/rest/api/products/{id}
provide the id , which you get as a response from create product api , in the url , you will get its all the information.

Automated test cases will be added later using the powermock and mockito.

Un can be execusted using the Unit-tests feature branch.

rest's People

Contributors

amitmbm avatar amitbankbazaar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.