GithubHelp home page GithubHelp logo

callicoder / spring-webflux-reactive-rest-api-demo Goto Github PK

View Code? Open in Web Editor NEW
160.0 8.0 133.0 63 KB

Build Reactive Rest APIs with Spring WebFlux and Reactive Mongo

Home Page: https://www.callicoder.com/reactive-rest-apis-spring-webflux-reactive-mongo/

Java 100.00%
spring-boot spring-webflux reactivemongo reactive-microservices reactor spring-reactive rest-api reactive-programming spring5 reactive-streams

spring-webflux-reactive-rest-api-demo's Introduction

Build Reactive Rest APIs with Spring WebFlux and Reactive MongoDB

Read the tutorial : https://www.callicoder.com/reactive-rest-apis-spring-webflux-reactive-mongo/

Requirements

  1. Java - 11

  2. Maven - 3.x.x

  3. MongoDB - 3.x.x

Steps to Setup

1. Clone the application

git clone https://github.com/callicoder/spring-webflux-reactive-rest-api-demo.git

2. Build and run the app using maven

cd spring-webflux-reactive-rest-api-demo
mvn package
java -jar target/webflux-demo-0.0.1-SNAPSHOT.jar

Alternatively, you can run the app without packaging it using -

mvn spring-boot:run

The server will start at http://localhost:8080.

Exploring the Rest APIs

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.

spring-webflux-reactive-rest-api-demo's People

Contributors

callicoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-webflux-reactive-rest-api-demo's Issues

Re the <scope>

Thanks for a great tutorial. The tests ran fine, sans pain. After testing I had trouble getting the Mongo db to come up when running, however, so I could try it from the browser. I discovered that if I changed the <scope> on the mongodb dependencies from tests to runtime the tests ran fine and the mongo server also came up. I might have been doing something wrong, but passing this along just in case.

Thank you!

Access secure mongo db

My mongo data base like
mongo --port 27017 -u "useradmin" -p "root" --authenticationDatabase "admin"

and i set my properties like this
spring.data.mongodb.uri=mongodb://localhost:27017/admin
spring.data.mongodb.username= useradmin
spring.data.mongodb.password= root

But i am not connect connection can you solve it...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.