This is a demonstration API project using Micronaut Framework.
Micronaut is a full-stack framework for building microservice and serverless applications. It leverages the use of compile-time inversion of control that results to quick start-up and low memory footprint.
This project demonstrates the CRUD operation using the framework and some Unit testing.
public class Application {
public static void main(String[] args) {
Micronaut.build(args)
.mainClass(Application.class)
.start();
}
}
Build the jar
gradlew shadowJar
Run the jar from the libs folder
java -jar micronaut-java-1.0-all.jar
Run using Gradle. Optionally, you can put -t option for live code reload.
gradlew run -t
Pull the image from Docker Hub
docker pull rjtmahinay/micronaut-java
Run the container using the image
docker run -d -p <port>:8080 --name <your container name> rjtmahinay/micronaut-java
- Access the swagger documentation via local environment
http://localhost:<port>/swagger-ui
/v1/synchronous/employee/add
Get all employee
/v1/synchronous/employee
Get a specific employee
/v1/synchronous/employee/{id}
/v1/synchronous/employee/update/{id}
/v1/synchronous/employee/delete/{id}
Demonstrates the returned response for an exception
/v1/synchronous/employee/exception
/v1/reactive/employee/add
Get all employee
/v1/reactive/employee
Get a specific employee
/v1/reactive/employee/{id}
/v1/reactive/employee/update/{id}
/v1/reactive/employee/delete/{id}
Demonstrates the returned response for an exception
/v1/reactive/employee/exception
H2 database is used for this demonstration project.
The project is licensed using MIT License