Building Reactive Rest Service with Spring Flux.
This Project based on the Spring 5/Spring Boot 2.0 and functional programming model.
Uses these packages:
- Spring Webflux
- Reactive-Mongo
- Spring 5
- Spring Boot 2.0
- Java 1.8
- MongoDB
Database name is hotels_db and collection name is hotels.
git clone https://github.com/batuhaniskr/spring-webflux-reactive-rest.git
MongoDB needs to be run.
sudo mongod
mvn clean install
mvn spring-boot:run
Application runs from http://localhost:8080/hotels
curl -X POST http://localhost:8080/hotels -H 'content-type: application/json' -d '{
"name": "Konak Hotel",
"address": "Çanakkale/Turkey",
"createdAt": "2018-01-01"
}'
curl -X POST http://localhost:8080/hotels -H 'content-type: application/json' -d '{
"name": "Balıklı Hotel",
"address": "Balıkesir/Turkey",
"createdAt": "2018-01-01"
}'
curl http://localhost:8080/hotels
curl http://localhost:8080/hotels/5a8d829cbb99221d55b5a221
curl -X PUT http://localhost:8080/hotels/5a8d83b9bb99221d55b5a222 -H 'content-type: application/json' -d '{
"name":"ErzurumHotel",
"address":"Erzurum/Turkey",
"createdAt":"2018-01-01"
}'