A service that allows you to get a random image of a frog or toad
- GET
/auth/singup
- registration page. Enter your name, email and password to register an account - POST
/auth/singup
- submit registration data.
/api/v1/generateToken
- generates a new token for the user and returns it. Requires basic authentication with an email address as user and password/api/v1/{token}/frog
- returns a random frog or toad image. Requires token
If the current day is wednesday /api/v1/{token}/frog
returns an image with the text "it's wednesday my dudes"
Images are stored in the image folder. When starting the service in S3, previously unloaded images are loaded. Next, the service works with the S3 storage
You have to provide configuration for postgres database and S3 storage:
spring:
datasource:
url:
username:
password:
minio:
endpoint:
accessKey:
secretKey:
bucket:
autoCreation: true
Additional properties you can see in application.yml
- Run
docker build -t vitekkor/frog-api-service:latest .
to build docker image - Run docker image:
docker run --name frog-api-service -p 8080:8080 \
-v path/to/custom/application.yml:/etc/vitekkor/frogapi/application.yml -d \
vitekkor/frog-api-service:latest
You can use docker compose to build and run service
- Set database password
POSTGRES_PASSWORD:
- Set minio credentials
MINIO_ROOT_USER:
MINIO_ROOT_PASSWORD:
- Set up volumes (optional)
- Run
docker-compose up -d