Skip to content

Instantly share code, notes, and snippets.

@Odilio
Created August 29, 2020 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Odilio/86411441ea6e345bd2a1536b5877aa48 to your computer and use it in GitHub Desktop.
Save Odilio/86411441ea6e345bd2a1536b5877aa48 to your computer and use it in GitHub Desktop.
package com.ktor
import io.ktor.application.*
import io.ktor.http.*
import io.ktor.response.*
import io.ktor.routing.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
fun main(args: Array<String>) {
val server = embeddedServer(Netty, port = 8080) {
routing {
get("/") {
call.respondText("Rota inicial!", ContentType.Text.Plain)
}
get("/login") {
call.respondText("Rota para tela de login!")
}
}
}
server.start(wait = true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment