Skip to content

dipayan/spring-boot-rest-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot REST Microservice

REST API written in Spring Boot

Pre-requisites

  • Download & install Java
  • Download & install Maven
 mvn clean install
  • Download & Install MySQL Server locally or use an external database (OPTIONAL)

For Developers

Installation

# 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

Running the application

Start the app

java -jar SampleProject-0.0.1-SNAPSHOT.jar

Usage

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/

Running the application as a Docker container

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 

Author

Dipayan Biswas

About

Spring Boot Micro-service REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published