danneu / kog

🌶 A simple Kotlin web framework inspired by Clojure's Ring.
43 stars 4 forks source link

[Router] Implement type-safe router #3

Closed danneu closed 7 years ago

danneu commented 7 years ago

The API could look something like this:

Router {
    get("/users/:id", fun(id: Int): Handler = { req ->
        Response().text("User $id")
    })
}

TODO:

danneu commented 7 years ago

Got the gist of it working: https://github.com/danneu/kog/commit/143f929e22cd1c998bb375ba530f2de476c5fdfd

Though isn't yet feature-full.

danneu commented 7 years ago

Deleted the old Router.kt and renamed SafeRouter.kt to Router.kt.