diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e4a1a9c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,44 @@ +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# +# These files are text and should be normalized (Convert crlf => lf) +*.bash text eol=lf +*.css text diff=css +*.df text +*.htm text diff=html +*.html text diff=html +*.java text diff=java +*.kt text +*.js text +*.json text +*.jsp text +*.jspf text +*.jspx text +*.properties text +*.sh text eol=lf +*.tld text +*.txt text +*.tag text +*.tagx text +*.xml text +*.yml text + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.dll binary +*.ear binary +*.gif binary +*.ico binary +*.jar binary +*.jpg binary +*.jpeg binary +*.png binary +*.so binary +*.war binary + +# Sourced from https://github.com/alexkaratarakis/gitattributes \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 95e1d5a..a45885e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.anthonycicchetti" -version = "0.1.1" +version = "0.1.2" repositories { mavenCentral() diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 9453b4c..1229b5a 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -13,7 +13,7 @@ object Versions { const val de_fayard_buildsrcversions_gradle_plugin: String = "0.3.2" - const val javalin: String = "2.8.0" // available: "3.0.0" + const val javalin: String = "3.0.0" const val org_jetbrains_kotlin_jvm_gradle_plugin: String = "1.3.31" diff --git a/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt b/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt index e6638ff..22264ad 100644 --- a/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt +++ b/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt @@ -3,7 +3,7 @@ package com.anthonycicchetti.slackbot import com.anthonycicchetti.slackbot.utility.Commands import com.anthonycicchetti.slackbot.utility.RespObj import com.anthonycicchetti.slackbot.utility.TextResponse -import io.javalin.Context +import io.javalin.http.Context import io.javalin.Javalin import org.slf4j.LoggerFactory @@ -11,18 +11,20 @@ fun main() { val logger = LoggerFactory.getLogger("main") val app = Javalin.create().start(7000) - app.get("/") { ctx -> ctx.result("Hello World") } + with(app) { + get("/") { ctx -> ctx.result("Hello World") } - app.post("/slack/receive") { ctx -> - handleSlackEvent(ctx) - } + post("/slack/receive") { ctx -> + handleSlackEvent(ctx) + } - app.post("/api/v1/spongebob") { ctx -> - ctx.json(TextResponse(200, ctx.body().toSpongemock())) - } + post("/api/v1/spongebob") { ctx -> + ctx.json(TextResponse(200, ctx.body().toSpongemock())) + } - app.post("/api/v1/uppercase") { ctx -> - ctx.json(TextResponse(200, ctx.body().toUpperCase())) + post("/api/v1/uppercase") { ctx -> + ctx.json(TextResponse(200, ctx.body().toUpperCase())) + } } }