A minor API to save events to MySQL database.
Start application with:
./gradlew bootRun
Start development dependencies with:
cd dev-database
sudo docker-compose up
Manually edit data on http://localhost:8081
User: root
Password: example
Docker image is build on docker hub.
Change value of MYSQL_PASSWORD and CLIENT_ID in ./docker-compose.yaml then run with:
sudo docker-compose up
This will start the API, MySQL database and Adminer (database client for viewing the data)
Adjust X-Client-Id equals to CLIENT_ID, then post:
curl --location --request POST 'http://localhost:9000/events' \
--header 'X-Client-Id: aaa' \
--header 'Content-Type: application/json' \
--data-raw '{
"eventType": "postmanPost",
"appId": "postman",
"timestamp": "2020-11-12T18:00:00.0Z",
"userId": "MouseClicker"
}'
X-Client-Id must be contained in the client application,
which means that the API is not secure.
Content type
Image
Digest
Size
96.8 MB
Last updated
over 5 years ago
docker pull jonev/events-api