8000 GitHub - inoxydabl3/REST-API
[go: up one dir, main page]

Skip to content

inoxydabl3/REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a simple Spring boot application that use REST API to manage the customer data for a small shop.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Git
  • OpenJDK >= 11

Installation

  1. Clone the repo
    git clone https://github.com/inoxydabl3/REST-API.git
  2. Performs a "plain" build
    ./mvnw clean install
  3. Run the application. Using our IDE we can create a launcher, or directly run it by executing the main method in the class com.example.demo.DemoApplication.

After that the application is running on the 8080 port. You can change the port by passing JVM Arguments:

-Dserver.port=8087

APIs Documentation with Swagger

This project is using Swagger that provides a user interface to access our RESTful web services via the web browser.

Swagger main page is - http://localhost:8080/swagger-ui.html

Dockerizing the APP

Prerequisites

  • Docker

Creating image

To create the image we just have to run the docker app and execute

./mvnw spring-boot:build-image

This process will create our image. Then we list the available docker images:

docker image ls -a

We see a line for the image we just created:

demo 1.0.0 279fe4df31bf

Run the image

We can execute the following command to run the image

docker run -d -p 8080:8080 demo:1.0.0

You'll notice a few flags being used. Here's some more info on them:

  • -d - run the container in detached mode (in the background)
  • -p 8080:8080 - map port 8080 of the host to port 8080 in the container
  • demo:1.0.0 - the image to use

Finally, if we want we can list the running containers

docker container ls

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0