https://github.com/arojunior/reactive-spring-experiments
Reactive Rest API with Spring WebFlux and Reactive MongoDB
https://github.com/arojunior/reactive-spring-experiments
java mongodb spring-boot
Last synced: 3 months ago
JSON representation
Reactive Rest API with Spring WebFlux and Reactive MongoDB
- Host: GitHub
- URL: https://github.com/arojunior/reactive-spring-experiments
- Owner: arojunior
- Created: 2018-03-14T03:00:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T03:00:25.000Z (over 8 years ago)
- Last Synced: 2024-12-28T12:42:37.898Z (over 1 year ago)
- Topics: java, mongodb, spring-boot
- Language: Java
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build Reactive Rest APIs with Spring WebFlux and Reactive MongoDB
## Requirements
1. Java - 1.8.x
2. Maven - 3.x.x
3. MongoDB - 3.x.x
OR
1. Docker
## Steps to Setup (without docker)
```bash
docker-compose up -d
```
That's it!
## Steps to Setup (without docker)
Note: without docker you should run MongoDB locally
**1. Clone the application**
```bash
git clone https://github.com/arojunior/reactive-spring-experiments.git
```
**2. Build and run the app using maven**
```bash
cd reactive-spring-experiments
mvn package
java -jar target/demo-0.0.1-SNAPSHOT.jar
```
Alternatively, you can run the app without packaging it using -
```bash
mvn spring-boot:run
```
## Exploring the Rest APIs
The server will start at .
The application defines following REST APIs
```
1. GET /tweets - Get All Tweets
2. POST /tweets - Create a new Tweet
3. GET /tweets/{id} - Retrieve a Tweet by Id
3. PUT /tweets/{id} - Update a Tweet
4. DELETE /tweets/{id} - Delete a Tweet
4. GET /stream/tweets - Stream tweets to a browser as Server-Sent Events
```
## Running integration tests
The project also contains integration tests for all the Rest APIs. For running the integration tests, go to the root directory of the project and type `mvn test` in your terminal.