https://kotlinlang.org logo
#ktor
Title
# ktor
r

Rui

03/12/2020, 2:52 PM
Hi guys, what is the best way to store global objects and data through out the application? I'm thinking about creating a singleton class object in main function or Application.module(), but not sure if it's a good practice. Is there any solid example on that?
e

Evan R.

03/12/2020, 2:57 PM
I usually use
object { }
declarations and pass their properties into
<http://Routing.XXX|Routing.XXX>()
type extension functions which define my routes
That way I can just choose which properties to mock when I add routes in my tests
3 Views