Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ht-rest-api

Tech

Source code available on GitHub public repository. Self-contained runnable release or pre-release jars available on GitHub public repository releases. For how to run a release or pre-release jar, see the Building and running a self-contained jar section.

Running with maven

Requires Apache Maven to run.

Available spring profiles to run:

  • dev - in memory h2 db - configuration in src/main/resources/application-dev.yml
  • staging - standalone MySQL db - configuration in src/main/resources/application-staging.yml - The schema will have to be created manually but the tables will be created by hibernate using "ddl-auto: update" on first run

Run with the default spring profile:

  • Default profile is dev - set default profile in src/main/application.yml
$ cd ht-rest-api 
$ mvn spring-boot:run

Run with a chosen spring profile and overrided application properties:

$ cd ht-rest-api 
$ mvn spring-boot:run -Drun.profiles=staging -Drun.arguments="--server.port=${server.port},--spring.datasource.url=${spring.datasource.url},--spring.datasource.username=${spring.datasource.username},--spring.datasource.password=${spring.datasource.password}"

Example with app defaults:

mvn spring-boot:run -Drun.profiles=staging -Drun.arguments="--server.port=9000,--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/testco_tech_db,--spring.datasource.username=htadmin,--spring.datasource.password=admin@ht"

Building and running a self-contained jar

Requires Apache Maven to build.

Building:

$ cd ht-rest-api 
$ mvn package spring-boot:repackage

Running with the default spring profile:

$ cd ht-rest-api 
$ cd target
$ java -jar restapi-0.0.1-SNAPSHOT.jar

Run with a chosen spring profile and overrided application properties:

$ cd ht-rest-api 
$ cd target
$ java -jar restapi-0.0.1-SNAPSHOT.jar --spring.profiles.active=staging --server.port=${server.port} --spring.datasource.url=${spring.datasource.url} --spring.datasource.username=${spring.datasource.username} --spring.datasource.password=${spring.datasource.password}

Example with app defaults:

java -jar restapi-0.0.1-SNAPSHOT.jar --spring.profiles.active=staging --server.port=9000 --spring.datasource.url=jdbc:mysql://127.0.0.1:3306/testco_tech_db --spring.datasource.username=htadmin --spring.dasource.password=admin@ht

Swagger UI

Running unit tests

$ cd ht-rest-api 
$ mvn test -P test

Running integration tests

$ cd ht-rest-api 
$ mvn integration-test -P integration

Development

Follow the steps in this article to setup lombok in eclipse/sts: Setup Lombok in STS

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages