use of io.dropwizard.assets.AssetsBundle in project microservices by pwillhan.
the class ServiceApplication method initializeViews.
private void initializeViews(final Bootstrap<ServiceConfiguration> bootstrap) {
List<ViewRenderer> viewRenders = new ArrayList<>();
viewRenders.add(new MustacheViewRenderer());
bootstrap.addBundle(new ViewBundle<>(viewRenders));
bootstrap.addBundle(new AssetsBundle("/assets", "/assets"));
}
use of io.dropwizard.assets.AssetsBundle in project Singularity by HubSpot.
the class SingularityService method initialize.
@Override
public void initialize(final Bootstrap<T> bootstrap) {
if (!Strings.isNullOrEmpty(System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY))) {
bootstrap.setConfigurationSourceProvider(new MergingSourceProvider(bootstrap.getConfigurationSourceProvider(), System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY), bootstrap.getObjectMapper(), new YAMLFactory()));
}
final Iterable<? extends Module> additionalModules = checkNotNull(getGuiceModules(bootstrap), "getGuiceModules() returned null");
final Iterable<? extends Bundle> additionalBundles = checkNotNull(getDropwizardBundles(bootstrap), "getDropwizardBundles() returned null");
final Iterable<? extends ConfiguredBundle<T>> additionalConfiguredBundles = checkNotNull(getDropwizardConfiguredBundles(bootstrap), "getDropwizardConfiguredBundles() returned null");
guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class).modules(new SingularityServiceModule()).modules(new SingularityAuthModule()).modules(additionalModules).build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new CorsBundle());
bootstrap.addBundle(new ViewBundle<>());
bootstrap.addBundle(new AssetsBundle("/assets/static/", "/static/"));
bootstrap.addBundle(new AssetsBundle("/assets/api-docs/", "/api-docs/", "index.html", "api-docs"));
bootstrap.addBundle(new MigrationsBundle<SingularityConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(final SingularityConfiguration configuration) {
return configuration.getDatabaseConfiguration().get();
}
});
for (Bundle bundle : additionalBundles) {
bootstrap.addBundle(bundle);
}
for (ConfiguredBundle<T> configuredBundle : additionalConfiguredBundles) {
bootstrap.addBundle(configuredBundle);
}
bootstrap.getObjectMapper().registerModule(new ProtobufModule());
bootstrap.getObjectMapper().registerModule(new GuavaModule());
bootstrap.getObjectMapper().setSerializationInclusion(Include.NON_NULL);
bootstrap.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
use of io.dropwizard.assets.AssetsBundle in project timbuctoo by HuygensING.
the class TimbuctooV4 method initialize.
@Override
public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) {
// bundles
activeMqBundle = new ActiveMQBundle();
bootstrap.addBundle(activeMqBundle);
bootstrap.addBundle(new MultiPartBundle());
bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.html"));
/*
* Make it possible to use environment variables in the config.
* see: http://www.dropwizard.io/0.9.1/docs/manual/core.html#environment-variables
*/
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(true)));
}
use of io.dropwizard.assets.AssetsBundle in project streamline by hortonworks.
the class StreamlineApplication method initialize.
@Override
public void initialize(Bootstrap<StreamlineConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets", "/", "index.html", "static"));
super.initialize(bootstrap);
}
use of io.dropwizard.assets.AssetsBundle in project registry by hortonworks.
the class RegistryApplication method initialize.
@Override
public void initialize(Bootstrap<RegistryConfiguration> bootstrap) {
// always deploy UI on /ui. If there is no other filter like Confluent etc, redirect / to /ui
bootstrap.addBundle(new AssetsBundle("/assets", "/ui", "index.html", "static"));
bootstrap.addBundle(new SwaggerBundle<RegistryConfiguration>() {
@Override
protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(RegistryConfiguration registryConfiguration) {
return registryConfiguration.getSwaggerBundleConfiguration();
}
});
super.initialize(bootstrap);
}
Aggregations