GithubHelp home page GithubHelp logo

demo-spring-native's Introduction

Spring Native Demo

This is a test with the new Spring Native, using Spring Web and MongoDB.

Running

To run should execute one of the following commands:

  • make build: Compile and generate the image.
  • make run: Execute compose to start the application (Need to run build command before).
  • make stop: Stop the execution, removing all containers.
  • make logs: Show container application logs.
  • make run-with-build: Execute the build and run.
  • make run-with-logs: The same as run-with-build, but with logs.

If you do not have make installed you can execute the following commands to compile and execute.

  • Build:
    $ ./mvnw clean spring-boot:build-image -DskipTests
  • Run:
    $ docker-compose up -d

Notice: You should have docker and docker-compose installed

Call endpoints

  • List users

    $ curl --location --request GET 'http://localhost:8080/users'
  • Create a user

    $ curl --location --request POST 'http://localhost:8080/users' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "name": "Fulano de Tal",
    "age": 25
    }'

Configurations

To reach the correct execution I needed to did some configurations.

I added --enable-all-security-services argument, because the spring data MongoDB need some security services to run.

I added a type hint for HttpStatus because the application was not finding the class and I added the hint to the compile include that class during the compilation.

For more details about Spring Native access here

demo-spring-native's People

Contributors

dgaraujo89 avatar

Watchers

 avatar

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.