Last active
December 27, 2015 16:09
-
-
Save julienrf/7352749 to your computer and use it in GitHub Desktop.
Play with control
This file contains 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
object Main extends App { | |
// You can retrieve the application configuration from any place | |
val configuration = Configuration("conf/my-app.conf") | |
// You instantiate your controllers with their required configuration | |
val application = new MyAbstractController(configuration) with SomeEventualMixin | |
// You pass your controllers as parameters to a router factory | |
val router = Router("conf/routes", application) | |
// You finally create the server | |
createServer(router, configuration) | |
} |
This file contains 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
object Main extends App { | |
// For convenience, the createServer method could have default values for its parameters | |
// so the line below would be equivalent to the following: | |
// createServer(Router("conf/routes"), Configuration("conf/application.conf")) | |
createServer() | |
} |
This file contains 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
// For even more convenience, we could have a PlayApp trait which body would contain the following: | |
// createServer() | |
object Main extends PlayApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... and this approach wouldn't prevent current integrated approach where "basic" users wouldn't care about it.