Giter Club home page Giter Club logo

restskeleton's Introduction

Restskeleton

Restskeleton is a small Rest web-service written in Java and using RestEasy 3 + Spring 3 + Maven 3.

The RestEasy is used to create the web resources, Spring to inject and manages the dependencies and Gson is used to convert object into JSON.

You can use it to prototype your Rest API or in production, why not? ;)

The ResponeBody is a valid JSON object with Content-type: application/json.

(This project uses an embedded version of Jetty.)

Dependencies

  • Java 7
  • Maven 3
  • Servlet-api 3.x

Versions of libraries

  • RestEasy 3.0.x
  • Spring 3.2.x
  • Gson 2.4

How to install?

$ mvn clean install

How to run?

$ mvn jetty:run

How to test if is runnig?

To see the results of the rest services, you can access:

Product service test:

http://localhost:8080/rest/product

{
  "success": "Endpoint of product works"
}

Get product by id:

http://localhost:8080/rest/product/123

{
  "id": 123,
  "name": "Silent Hill 2",
  "description": "Game Silent Hill 2",
  "keywords": [
    "silent hill 2",
    "game",
    "playstation 2",
    "xbox",
    "pc"
  ]
}

Where can I edit this resource?

You can change or add a new Resource inside the package:

src/main/java/com/example/restskeleton/resources/

The unit test for this resource are in:

src/test/java/com/example/restskeleton/resources/ProductResourceTest.java

Eclipse

If you use Eclipse to develop, you can import this application as an "Existing Maven Projects".

  1. Right click on Package Explorer
  2. Import...
  3. Existing Maven Projects
  4. Select the project folder
  5. Click on Finish button

I hope you enjoy :)

restskeleton's People

Contributors

madureira avatar

Stargazers

 avatar

Watchers

 avatar  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.