Skip to content

Latest commit

 

History

History

README.md

OpenAPI generated server

Spring Boot Server

Overview

This server was generated by the OpenAPI Generator project. By using the OpenAPI-Spec, you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.

The underlying library integrating OpenAPI to SpringBoot is springfox

Start your postgres database using provided docker-compose file:

docker-compose -f deployment/docker-compose/postgres.yaml up -d

Start your server as a simple java application:

mvn spring-boot:run

You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/

Change default port value in application.properties

Running with Docker

To run the server on a Docker container, please execute the following from the root directory:

# Build application
mvn clean package -Dmaven.test.skip

# Extract the FAT jar
mkdir target/docker-packaging && (cd target/docker-packaging; jar -xf ../*.jar)
# building the image
docker build -t bookservice .

# starting up a container
docker run -p 8080:8080 bookservice

and open your browser to here:

http://localhost:8080/