Coder Social home page Coder Social logo

springboot-crud-actuator's Introduction

Spring Boot REST API CRUD and Actuators Dockerified

Spring boot app with a basic todos rest api and the actuators all turned on

Build app

build with jdk 11+

$ ./gradlew build

Build docker container

$ docker build --build-arg JAR_FILE=build/libs/\*.jar -t springboot-crud-actuator:latest .

Create and run docker container

$ docker run --name springboot-crud-actuator -d -p 8080:8080 springboot-crud-actuator:latest

OR run latest image from docker hub with...

$ docker run -d -p 8080:8080 dawogfather/springboot-crud-actuator:latest

Push to docker hub

$ docker login

$ docker tag springboot-crud-actuator:latest <username>/springboot-crud-actuator:latest

$ docker push <username>/springboot-crud-actuator:latest

Use App

Get ENV vars

$ curl 'http://localhost:8080/actuator/env' -i -X GET | jq .

Get Todos

$ curl 'http://localhost:8080/api/todo' -i -X GET | jq .

Create TODO

$ curl -X POST -H "Content-Type: application/json" -d '{"title":"Keep being awesome", "description":"Complete assignments", "todoStatus":"NOT_COMPLETED"}' http://localhost:8080/api/v1/todo

Update TODO

$ curl -X PUT -H "Content-Type: application/json" -d '{"title":"Go to school mate", "description":"Complete assignments", "todoStatus":"COMPLETED"}' http://localhost:8080/api/v1/todo/2

Delete TODO

$ curl -X DELETE -H "Content-Type: application/json" http://localhost:8080/api/v1/todo/2

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.