Sign inSign up

mixaverross88/java-restfull-api

By mixaverross88

•Updated over 5 years ago

RESTful APIs with JAX-RS

Image
1

1.4K

mixaverross88/java-restfull-api repository overview

Quality Gate Status Build Status preview image preview image preview image preview image Known Vulnerabilities

⁠RESTful APIs with JAX-RS

preview image

⁠Docker Instructions

preview image You can run the dockerRun.sh in order to spin up a docker container.

curl -LOk https://github.com/mixaverros88/java-api/raw/master/target/demorest.war

Spin up the container.

docker run -it -p 80:8080 -v /$(pwd):/usr/local/tomcat/webapps mixaverross88/java-restfull-api:1.1

Or run the compose file.

docker-compose up

Navigate to the following link.

[docker-machine ip]:80/demorest/
⁠See the docker file in the Docker Hub

https://hub.docker.com/r/mixaverross88/java-restfull-api⁠

⁠Status codes for CRUD operations

OperationURIMethodSuccess/FailureStatus Code
Get Messagemessages/{messageId}GetSuccess200
Not found404
Failure500
Delete Messagemessages/{messageId}DeleteSuccess200 or 204
Not found404
Failure500
Edit Messagemessages/{messageId}PutSuccess201
Wrong Format data400 or 415
Not found404
Failure500
Create MessagemessagesPostSuccess201
Wrong Format data400 or 415
Not found404
Failure500
⁠:computer: Deploy instructions

Use the maven plug-in (tomcat7-maven-plugin) for tomcat server in order to automatically deploy this project in your local server. You can find this plug-in in pom.xml file in order to modify with yours configurations, also don't forget to add in settings.xml your credentials for tomcat server.

<servers>
    <server>
        <id>TomcatServer</id>
        <username>admin</username>
        <password>password</password>
    </server>
</servers>

You can run the below command in order to deploy the artifact in your local tomcat server

mvn clean tomcat7:deploy

⁠This rest api follows the Richardson Maturity Model

preview image

  1. Resource URI (Individual URIs for each resource)
  2. HTTP Methods (GET, POST, PUT, DELETE)
  3. HATEOAS (Responses have links that the clients can use)

⁠Postman Collection

preview image You can find in postman folder a json to run tests via newman.

⁠Jenkins

You are able to use Jenkinsfile in order to create pipe line for jenkins.

Tag summary

Content type

Image

Digest

Size

83.8 MB

Last updated

over 5 years ago

docker pull mixaverross88/java-restfull-api