Code Monkey home page Code Monkey logo

spring-boot2-sample-webflux's Introduction

Spring Boot 2 Sample Webflux Application

This is a sample application using Spring Boot 2 with Spring Webflux.

Getting stated

JDK 9

In order to get started with this sample application you need to install JDK 9. You can use SDKMAN! for that if you want.

MongoDB

The application need a running MongoDB instance, the easiest way to start one, is through docker

docker run --name some-mongo mongo

Then you need to get the IP address of the mongo container

docker inspect --format '{{ .NetworkSettings.IPAddress }}'  some-mongo

If the IP address is not 172.17.0.2, then you must change the IP address specified in the file src/main/resources/application-local.yml under the key spring.data.mongodb.host

spring:
  data:
    mongodb:
      host: 172.17.0.2

Start the application

In order to start the sample application just call

./gradlew bootRun

or on Windows

./gradlew.bat bootRun

IDE

You can use an IDE to look at the source code, I recommend the Spring Tool Suite, but you use any IDE that you see fit.

Example requests

These example requests are issued through HTTPie.

GET a list of customers
http -v -a user:user :8080/customers/
GET a list of customers with paging
http -v -a user:user :8080/customers/ size==2 page==1
GET a customer by id
http -v -a user:user :8080/customers/5acb629d859c16689db5f091
CREATE a customer
http -v -a admin:admin POST :8080/customers/ firstName=Daenerys lastName=Targaryen
DELETE a customer by id
http -v -a admin:admin DELETE :8080/customers/5ae2ef2a7593241a65e2b961
Stream customers
http --stream -v -a user:user :8080/customers/stream 'Accept: text/event-stream'

spring-boot2-sample-webflux's People

Contributors

brianpreuss avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

aspineon

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.