Created
August 15, 2020 21:45
-
-
Save mertcb/c9d1311adf72593e5aaa08af8701af41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mertcb.sskotlin | |
import io.ktor.application.* | |
import io.ktor.features.ContentNegotiation | |
import io.ktor.gson.gson | |
import io.ktor.routing.* | |
import java.text.DateFormat | |
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args) | |
@Suppress("unused") // Referenced in application.conf | |
@kotlin.jvm.JvmOverloads | |
fun Application.module(testing: Boolean = false) { | |
install(ContentNegotiation) { | |
gson { | |
setDateFormat(DateFormat.LONG) | |
setPrettyPrinting() | |
} | |
} | |
routing { | |
this.users() | |
this.addUser() | |
this.greetUser() | |
} | |
} | |
data class User(val name:String) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment