Simple CRUD API that stores notes
yadev/storeme-api
EnvVars:
SPRING_PROFILES_ACTIVE: local, dev, prod and actuator
DB_HOST: hostname or service (container) name
DB_NAME: database name
DB_USER: username for database
DB_PASSWORD: password for db user
CORS_ALLOWED_DOMAINS: normally frontend domain (format: https://mydomain.tld)
Optional EnvVars:
LOG_LEVEL_APP: see Logging part
PORT: start server at port other than 8080
JAVA_DEBUG_PORT: port for remote debugging
(this is internal port, need to expose it to connect from outside word)
Ports:
host port: select yourself
container port: 8080 (or PORT)
Secrets:
database password
Volumes:
/opt/dumps
(volume to store heap dumps, when app crashed)Git clone git clone repoUrl
Import into an IDE as Maven project
Select all autodetected Spring facets
To develop with locally running dockerized MySQL database use local
profile.
Profile can activated in IDEA or by setting env SPRING_PROFILES_ACTIVE
to local
MySQL can be started from docker/localMySQL
directory by running:
docker-compose up -d
MySQL can be stopped from docker/localMySQL
directory by running:
docker-compose down
Located: here
To adjust logging we use ENV variables or -D
vars:
Use LOG_LEVEL_CORE
or -Dlog.level.core
for setting overall log level
Use LOG_LEVEL_APP
or -Dlog.level.app
for setting application (package: ee.yals
) log level
Use LOG_LEVEL_SPRING
or -Dlog.level.spring
for setting Spring (package: org.springframework
) log level
Use LOG_LEVEL_DB
or -Dlog.level.db
for setting Database SQL (package: org.hibernate
) log level
Test URL defined by -Dtest.url
property. Should be with protocol.
Browsers are defined by -Dtest.browsers
. Supported browsers: Chrome, Firefox, Safari, IE, Edge.
Can add several browsers like chrome,firefox
Report dir can be changed using -Dtest.reportdir
property
Local server port can be changed using -Dport
property