use of io.dropwizard.assets.AssetsBundle in project dropwizard by dropwizard.
the class HelloWorldApplication method initialize.
@Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addCommand(new RenderCommand());
bootstrap.addBundle(new AssetsBundle());
bootstrap.addBundle(new MigrationsBundle<HelloWorldConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(HelloWorldConfiguration configuration) {
return configuration.getDataSourceFactory();
}
});
bootstrap.addBundle(hibernateBundle);
bootstrap.addBundle(new ViewBundle<HelloWorldConfiguration>() {
@Override
public Map<String, Map<String, String>> getViewConfiguration(HelloWorldConfiguration configuration) {
return configuration.getViewRendererConfiguration();
}
});
}
use of io.dropwizard.assets.AssetsBundle in project graphhopper by graphhopper.
the class GraphHopperApplication method initialize.
@Override
public void initialize(Bootstrap<GraphHopperServerConfiguration> bootstrap) {
bootstrap.addBundle(new GraphHopperBundle());
bootstrap.addBundle(new RealtimeBundle());
bootstrap.addCommand(new ImportCommand());
bootstrap.addCommand(new MatchCommand());
bootstrap.addBundle(new AssetsBundle("/com/graphhopper/maps/", "/maps/", "index.html"));
// see this link even though its outdated?! // https://www.webjars.org/documentation#dropwizard
bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/webjars/", null, "webjars"));
}
use of io.dropwizard.assets.AssetsBundle in project pinot by linkedin.
the class ThirdEyeDashboardApplication method initialize.
@Override
public void initialize(Bootstrap<ThirdEyeDashboardConfiguration> bootstrap) {
bootstrap.addBundle(new ViewBundle());
bootstrap.addBundle(new HelperBundle());
bootstrap.addBundle(new AssetsBundle("/assets", "/assets"));
bootstrap.addBundle(new AssetsBundle("/assets/css", "/assets/css", null, "css"));
bootstrap.addBundle(new AssetsBundle("/assets/js", "/assets/js", null, "js"));
bootstrap.addBundle(new AssetsBundle("/assets/lib", "/assets/lib", null, "lib"));
bootstrap.addBundle(new AssetsBundle("/assets/img", "/assets/img", null, "img"));
bootstrap.addBundle(new AssetsBundle("/assets/data", "/assets/data", null, "data"));
}
use of io.dropwizard.assets.AssetsBundle in project api-core by ca-cwds.
the class BaseApiApplication method configureSwagger.
private void configureSwagger(final T apiConfiguration, final Environment environment) {
BeanConfig config = new BeanConfig();
SwaggerConfiguration swaggerConfiguration = apiConfiguration.getSwaggerConfiguration();
config.setTitle(swaggerConfiguration.getTitle());
config.setDescription(swaggerConfiguration.getDescription());
config.setResourcePackage(swaggerConfiguration.getResourcePackage());
config.setScan(true);
new AssetsBundle(swaggerConfiguration.getAssetsPath(), swaggerConfiguration.getAssetsPath(), null, "swagger").run(environment);
LOGGER.info("Registering ApiListingResource");
environment.jersey().register(new ApiListingResource());
LOGGER.info("Registering SwaggerResource");
SwaggerResource swaggerResource = new SwaggerResource(swaggerConfiguration);
environment.jersey().register(swaggerResource);
if (swaggerConfiguration.isShowSwagger()) {
TokenResource tokenResource = new TokenResource(swaggerConfiguration);
environment.jersey().register(tokenResource);
}
}
use of io.dropwizard.assets.AssetsBundle in project newts by OpenNMS.
the class NewtsService method initialize.
@Override
public void initialize(Bootstrap<NewtsConfig> bootstrap) {
bootstrap.addCommand(new InitCommand());
bootstrap.addBundle(new AssetsBundle("/app", UI_URL_PATH, "index.html"));
}
Aggregations