use of com.datastax.fallout.util.MustacheViewRendererWithoutTemplatingErrors in project fallout by datastax.
the class FalloutServiceBase method initialize.
@Override
public void initialize(Bootstrap<FC> bootstrap) {
bootstrap.addBundle(new ViewBundle<FC>(Set.of(new MustacheViewRendererWithoutTemplatingErrors(), // SwaggerBundle uses Freemarker templates
new FreemarkerViewRenderer())) {
@Override
public Map<String, Map<String, String>> getViewConfiguration(FC configuration) {
return Boolean.getBoolean("fallout.devmode") ? Map.of("mustache", Map.of("cache", "false", "fileRoot", "src/main/resources")) : Map.of();
}
});
bootstrap.addBundle(new AssetsBundle("/assets", ASSETS_ROOT_PATH));
bootstrap.addCommand(new FalloutExecCommand<>(this));
bootstrap.addCommand(new FalloutValidateCommand<>(this));
bootstrap.addCommand(new FalloutStandaloneCommand<>(this));
bootstrap.addCommand(new FalloutRunnerCommand<>(this));
bootstrap.addCommand(new FalloutQueueCommand<>(this));
bootstrap.addCommand(new CheckCommand<>(this));
bootstrap.addCommand(new GenerateNginxConf<>(this));
bootstrap.addCommand(new Cassandra<>(this));
bootstrap.addBundle(new SwaggerBundle<>() {
@Override
protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(FC configuration) {
SwaggerBundleConfiguration swaggerBundleConfiguration = new SwaggerBundleConfiguration();
swaggerBundleConfiguration.setResourcePackage("com.datastax.fallout.service.resources." + (configuration.getMode() == ServerMode.RUNNER ? "runner" : "server"));
if (configuration.getExternalUrl() != null) {
swaggerBundleConfiguration.setSchemes(new String[] { URI.create(configuration.getExternalUrl()).getScheme() });
}
return swaggerBundleConfiguration;
}
});
bootstrap.setObjectMapper(JacksonUtils.getObjectMapper());
}
Aggregations