Structuring with modules
A Ktor Application consists of a series of one or more modules, each of which can house any kind of functionality.
A Ktor module is just a user-defined function receiving the
Application class that is in charge of configuring the server pipeline, install plugins, registering routes, handling requests, etc.
You have to specify the modules to load when the server starts in the
A simple module function would look like this:
Of course, you can split the module function in several smaller functions or classes.
Modules are referenced by their fully qualified name: the fully qualified name of the class and the method name, separated by a dot (
So for the example, the module's fully qualified name would be: