Skip to content

diogoalbuquerque/native-person-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Native Application

Generate Executable

Person API

API for create and find people.

Goal

Create a POC application for an API using Spring Native, Spring Web, Spring Data and Spring Validation.

With these dependencies it was possible to create an API that create and find a person.

Composition

The project is composed of the domain module and the application module.

Tests

Although there are tests, @MockBean is not supported by Spring AOT.

Build

To build the project is necessary to have GRAALVM correctly configured.

Then run the command below.

mvn -Pnative -DskipTests clean package

❗ Use -DskipTests for prevents tests from being called and this way can compile without any problems.

Run

After the build, the artifact will be available at: /application/target/

Just run the application artifact

./application

Endpoints

Find person

    GET /v1/person/1 HTTP/1.1
    Content-Type: application/json
    Host: localhost:8080

Create person

    POST /v1/person HTTP/1.1
    Content-Type: application/json
    Host: localhost:8080
    Content-Length: 37
    
    {
        "name": "User Test2",
        "age": 18
    }

About

API for create and find people using Spring native.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published