Last active
July 16, 2018 00:14
-
-
Save xerial/f08ebac82a8cc018a260efad0330bbf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wvlet.airframe._ | |
// Read configurations from a YAML file | |
val yaml = readConfig("config.yml") | |
// Configure Application | |
val d = newDesign | |
.bind[ServiceConfig].toInstance(new ServiceConfig(yaml.get(...), yaml.get(..)) | |
.bind[WebAppConfig].toInstance(new WebAppConfig(...)) | |
// Initialize Services | |
d.build[WebApp]{ webApp => | |
// new WebApp(session.get[WebAppConfig], session.get[WebComponent]) will be called | |
// new WebComponent(session.get[Service]) will be called | |
// new Service(session.get[ServiceConfig]) will be called | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment