Skip to content

java-tips/spring-kotlin-mongo

Repository files navigation

spring-kotlin-mongo

CircleCI CircleCI deepcode

This is a Kotlin application with spring-boot and MongoDB.
Kotlin in the backend provides less code and is easy to build.
You can take a look at the official documentation https://kotlinlang.org/docs/reference/server-overview.html
It is very easy to use that. Below I'll show you how you can build the application.


Build and Start:
./gradlew clean
./gradlew build
./gradlew bootRun
In this way you need to start a Mongodb instance as well.

With Docker Compose, Build and Start:
docker-compose up --build
In this way you don't need to start a Mongodb instance.
Open the browser:
http://localhost:8080/v1/ping

Routes:
GET http://localhost:8080/v1/ping
GET http://localhost:8080/v1/order
POST http://localhost:8080/v1/order
GET http://localhost:8080/v1/order/{status}

*You can change everything if you will.

Enjoy it :D