Skip to content

Instantly share code, notes, and snippets.

@dehora
Created May 23, 2012 02:24
Show Gist options
  • Save dehora/2772882 to your computer and use it in GitHub Desktop.
Save dehora/2772882 to your computer and use it in GitHub Desktop.
n resources with dropwizard
object ServiceMain extends ScalaService[ServiceConfiguration]("record-service") {
def initialize(configuration: ServiceConfiguration, environment: Environment) {
val injector: Injector = Guice.createInjector(
new ConfigModule(configuration),
new NotifyModule(),
new AccountModule(),
new CollectionModule()
)
// root resource routing not needed, just add the things in and give them paths
environment.addResource(injector.getInstance(classOf[AccountResource]))
environment.addResource(injector.getInstance(classOf[CollectionResource]))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment