Skip to content

added implementation on top of api server stubs generated from swagger specs yml

Notifications You must be signed in to change notification settings

bordz/swgapi-impl

Repository files navigation

Swagger generated server

Spring Boot Server

Overview

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

The underlying library integrating swagger to SpringBoot is springfox

Start your server as an simple java application

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

Change default port value in application.properties

Build Procedures

  1. Using maven to build the application jar
mvn package
  1. Run the application locally
cd target; java -jar appname-version.jar
  1. Build docker image
mvn package docker:build
  1. Run the build docker image
# look up prefix/artifactId at pom.xml (at docker-maven-plugin configuration block)
sudo docker run -p 8080:8080 -d prefix/artifactId

# view logs
sudo docker logs prefix/artifactId

# bash into the container
sudo docker exec -it prefix/artifactId bash
  1. Build and push the image to docker registry
# if not yet done, login first
sudo docker login

# TBD save docker registry credentials to some config file

# main command
mvn package docker:build docker:push

# or alternatively
sudo docker push prefix/artifactId:latest

Production Deploy Procedures

should provide proper documentation on how to deploy to production

Reference

About

added implementation on top of api server stubs generated from swagger specs yml

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages