Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created December 4, 2015 07:00
Show Gist options
  • Select an option

  • Save javaeeeee/d66c1e2c2b60500e4407 to your computer and use it in GitHub Desktop.

Select an option

Save javaeeeee/d66c1e2c2b60500e4407 to your computer and use it in GitHub Desktop.
public class DWGettingStartedApplication
extends Application<DWGettingStartedConfiguration> {
...
@Override
public void run(final DWGettingStartedConfiguration configuration,
final Environment environment) {
...
//Create Jersey client.
final Client client = new JerseyClientBuilder(environment)
.using(configuration.getJerseyClientConfiguration())
.build(getName());
//Register authenticator.
...
//Register a resource using Jersey client.
environment.jersey().register(
new ConverterResource(
client,
configuration.getApiURL(),
configuration.getApiKey())
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment