@Override
    public void run(HelloWorldConfiguration helloWorldConfiguration, Environment environment) throws Exception {

        environment.jersey().register(new BasicAuthProvider<Boolean>(new PhonebookAuthenticator(),"Web Service Realm"));

        final HelloWorldResource resource = new HelloWorldResource(helloWorldConfiguration.getTemplate(),helloWorldConfiguration.getDefaultName());
        environment.jersey().register(resource);

        final DBIFactory factory = new DBIFactory();
        final DBI jdbi = factory.build(environment,helloWorldConfiguration.getDataSourceFactory(),"mysql");

        final ContactResource contactResource = new ContactResource(jdbi);
        environment.jersey().register(contactResource);

        final Client client = new JerseyClientBuilder(environment).build("REST Client");

        environment.jersey().register(new ClientResource(client));

        final TemplateHealthCheck healthCheck =
                new TemplateHealthCheck(helloWorldConfiguration.getTemplate());
        environment.healthChecks().register("template", healthCheck);
        environment.jersey().register(resource);
    }