RESTHeart v5 examples
RESTHeart is the REST API for MongoDB. With RESTHeart you can easily access MongoDB via a REST API, but it's also possible to create any kind of custom Web service.
This repository provides examples on how to extend RESTHeart v5 with Java or Kotlin plugins.
The parent POM defines common properties while each module implements a single example.
The only required Maven dependency for building Java plugins is restheart-commons
:
<dependency>
<groupId>org.restheart</groupId>
<artifactId>restheart-commons</artifactId>
<version>Tag</version>
</dependency>
You can use this repository as a foundation for implementing your own plugins.
Setup
You need both JDK 11+ and Maven to build and run this example.
- Clone this repo
git clone git@github.com:SoftInstigate/restheart-examples.git
. cd
into therestheart-examples
folder.- Download RESTHeart.
- Uncompress it:
unzip restheart.zip
ortar -xvf restheart.tar.gz
. cd
into each module folder for specific instructions.
Modules
- Hello world example - A basic Java REST Web service.
- MongoDB serverStatus service - Implements the serverStatus MongoDB system call.
- Random String service - Shows how to deploy a service that uses external dependencies.
- CSV Interceptor - Converts coordinates from CSV to a GeoJSON object.
- User Signup - Implements a user signup process. This is an example of a complex process implemented with few interceptors, a service and uses json schema validation and security permissions.
- Kotlin Greeter Service - Simple service implemented in Kotlin programming language.