Create Services

Cloning a Starter repository

To create a new Hexagon service, you can clone a minimum running example using the Gradle Starter or the Maven Starter.

From scratch

You can write a Gradle project from scratch (Gradle 6.4 or newer is required) using the following build.gradle:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
plugins {
    id "org.jetbrains.kotlin.jvm" version "1.3.72"
}

apply(plugin: "kotlin")
apply(plugin: "application")

application {
    mainClassName = "HelloKt"
}

repositories {
    jcenter ()
    maven { url "https://dl.bintray.com/hexagonkt/hexagon" }
}

dependencies {
    implementation("com.hexagonkt:http_server_jetty:$hexagonVersion")
}

Comments