REST API written in Spring Boot
mvn clean install
- Download & Install MySQL Server locally or use an external database (OPTIONAL)
- Download & install Spring Tool Suite
# Clone the repository
git clone https://github.com/dipayan/spring-boot-rest-microservice.git
# Change into the directory
cd spring-boot-rest-microservice
# Install all required dependencies with
mvn clean install -Dmaven.test.skip=true
Start the app
java -jar SampleProject-0.0.1-SNAPSHOT.jar
API Specifications
- GET: /api/v1/orders
- GET: /api/v1/orders/{order_id}
- POST: /api/v1/orders
- PUT: /api/v1/orders/{order_id}
- DELETE: /api/v1/orders/{order_id}
Example Get all orders curl http://localhost:8080/api/v1/orders/
cd spring-boot-rest-microservice
# Build the docker image
docker build -t spring-boot-app .
# Run the docker container and put the port as specified in the .env file
docker run -d -p 8080:8080 --name spring-boot-app spring-boot-app
# Check the logs
docker logs -f spring-boot-app
# Cleaup the container
docker stop spring-boot-app && docker rm spring-boot-app
Dipayan Biswas