You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question/Feature request: I tend to write apps where the code is grouped by feature/package (opposed to group-by-layer) in order to achieve cleaner code, especially when it comes to larger codebases. I'm a newbie to Kotlin and haven't figured a way how to group routes into controllers using spark-kotlin, sparkjava supports this pattern. Is this possible, and if so how? In case it isn't, would it be possible to add support for it to spark-kotlin?
The text was updated successfully, but these errors were encountered:
@pehagg It is possible; each controller class defines its own routes in the constructor init { } block. The main server class just needs to initialise each controller on statup. I've got a toy example working at https://github.com/v79/kotlin-spark-routes . Adding spark's paths would help with this ( #15 ). I've tried calling Spark.path("/users/") {... } but it breaks staticFiles() for me.
Question/Feature request: I tend to write apps where the code is grouped by feature/package (opposed to group-by-layer) in order to achieve cleaner code, especially when it comes to larger codebases. I'm a newbie to Kotlin and haven't figured a way how to group routes into controllers using spark-kotlin, sparkjava supports this pattern. Is this possible, and if so how? In case it isn't, would it be possible to add support for it to spark-kotlin?
The text was updated successfully, but these errors were encountered: