I personally prefer functional structure. So you have a
main
function which installs all the features, opens
routing
and then calls functions for various parts of the system.
Copy code
public Application.main() {
install(…)
install(…)
routing {
users() // user routes
articles() // article routes
}
}
// in other file
fun Route.users() {
get("users") {…}
}
i
ice32
06/16/2017, 1:19 PM
orangy: Seems interesting. But how are the modules structured? Eg. users module?
o
orangy
06/16/2017, 1:20 PM
There are plenty of variants, what kind of application are you planning? Lots of endpoints? Few endpoints? Stateful/stateless?
orangy
06/16/2017, 1:20 PM
(I will need to go for a while now, will respond later)
i
ice32
06/16/2017, 1:32 PM
I'm looking for a structure to experiment with a RESTful JSON api. Nothing too specific, I'm just looking for a way to get started, while doing it properly and keeping it scalable/modular from the beginning. It doesn't have to be a perfect fit, I can adapt a structure to my needs