Skip to content

tgvdinesh/skeleton-web-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

skeleton-web-services Build status

Our primary goals are:

  • Create Spring Boot MVC web application

  • Use Hibernate for database ORM

  • Use any CI (eg. Jenkins CI, Travis CI)

  • Use Docker for deployment

Installation and Getting Started

Here is a quick teaser of how to setup Docker and run the code:

# Docker basics to build image from existing java image
# Pull a java docker image
docker pull openjdk
# Navigate to project directory and execute below command
docker build -t skeleton-web-services .
# run the built image with name
docker run --name skeleton-web-services skeleton-web-services
# To push the code to server. You need to have hub.docker.com account and a project name. Ommit this step if you are using existing image
docker tag skeleton-web-services dineshshabde/skeleton-web-services
docker login --username=username --email=email@domain.com
# After every changes push the image to server
docker push dineshshabde/skeleton-web-services

#To run the code
----------------
# Docker get latest update
docker pull dineshshabde/skeleton-web-services
# Run the code. Bind the port of docker to host
docker run -p 8080:8080 dineshshabde/skeleton-web-services

CURL command to get data

Get data
curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: c2a293e9-19f0-ebd7-9414-1a57c90e674a" "http://localhost:8080/api/greetings/2"

Update specific data
curl -X PUT -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 90745b40-0f27-dc2d-710c-2eb89a2d239a" -d '{"id": 2 ,"text":"BMW"}' "http://localhost:8080/api/greetings/2"

Add data
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: c2bd1e8e-b3f6-195e-3c5f-5c6c5ebaba76" -d '{"text":"Amazon"}' "http://localhost:8080/api/greetings/"

Get all data
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8080/api/greetings

Delete a specific data
curl -X DELETE -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 0ba75d1d-7bb0-a53f-2987-be62e8d33252" -d '{"id":2}' "http://localhost:8080/api/greetings/2"

Asynchronus
curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: ae48d829-48bd-c3ac-08a9-ab44575c8f94" "http://localhost:8080/api/greetings/2/send?wait=true"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages