Created
August 30, 2013 09:45
-
-
Save hhariri/6388181 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
data class Customer(val id: Int, val name: String, val email: String, val country: String) | |
val customerList = arrayListOf<Customer>( | |
Customer(1, "Joe Smith", "[email protected]", "UK"), | |
Customer(2, "Jack Jones", "[email protected]", "US"), | |
Customer(3, "Maria Gonzalez", "[email protected]", "Spain") | |
) | |
fun main(args: Array<String>) { | |
val appServer = AppServer() | |
appServer.negotiateContent() | |
appServer.get("/customer", listCustomers) // this can be inline or implemented somewhere else, as in this case | |
appServer.start() | |
} | |
val listCustomers = handler { | |
response.send(customerList) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment