Springboot CRUD api using containerized mongoDB. Feel free to use it as an example for your projects.
Make sure ports 27017 & 8080 are available.
javongo/
mkdir -p mongodb/db
docker-compose up -d
javongo/javongo/
./gradlew bootRun
Server should be running on localhost:8080.
GET /javongos
GET /javongo/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of javongo to fetch |
POST /javongo
Request body
{
"message": "<your-javongo-message>"
}
Parameter | Type | Description |
---|---|---|
message |
string |
Required. Message of new javongo |
PUT /javongo/${id}
Request body
{
"message": "<your-javongo-message>"
}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of javongo to update |
message |
string |
Required. Message of updated javongo |
DELETE /javongo/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of javongo to remove |
javongo/
docker-compose down -v
You can kill the springboot process, pressing Ctrl + c in the terminal where the procces is running.
Made with π and </>.