Sample Spring application accessing data with MongoDB
To run the application, execute:
mvn spring-boot:run
Once started you can access the APIs:
http://localhost:8080/heroes
POST http://localhost:8080/heroes
Accept: application/json
Content-Type: application/json
{
"name" : "Superman",
"powers" : [
"Flight",
"Superhuman Speed",
"Superhuman strength"
],
"enemies": [
{
"name" : "Lex Luthor"
},
{
"name" : "Darkseid"
}
]
}
RESPONSE: HTTP 201 (Created)
GET http://localhost:8080/heroes?page=0&size=10
Response: HTTP 200