Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bazaarvoice/dropwizard-configurable-assets-bundle
An implementation of an AssetBundle for use in Dropwizard that allows user configuration.
https://github.com/bazaarvoice/dropwizard-configurable-assets-bundle
Last synced: about 2 months ago
JSON representation
An implementation of an AssetBundle for use in Dropwizard that allows user configuration.
- Host: GitHub
- URL: https://github.com/bazaarvoice/dropwizard-configurable-assets-bundle
- Owner: bazaarvoice
- License: apache-2.0
- Archived: true
- Created: 2012-10-25T23:02:17.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-08T14:39:34.000Z (over 8 years ago)
- Last Synced: 2024-08-04T01:05:52.717Z (5 months ago)
- Language: Java
- Size: 147 KB
- Stars: 55
- Watchers: 24
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-dropwizard - dropwizard-configurable-assets-bundle - An implementation of an AssetBundle for use in Dropwizard that allows user configuration. (Open Source / Assets)
README
# Configurable Assets Bundle for Dropwizard
**NOTE: THIS PROJECT IS DEPRECATED.** This projects is no longer maintained. It is deprecated for
[dropwizard-bundles maintained fork](https://github.com/dropwizard-bundles/dropwizard-configurable-assets-bundle).
Users of this project should update their project dependencies appropriately.This GitHub repository contains a drop-in replacement for Yammer's `AssetsBundle` class that allows for a better
developer experience. Developers can use the `ConfiguredAssetsBundle` class anywhere they would use a `AssetsBundle`
in their Dropwizard applications and take advantage of the ability to specify redirects for URIs to that loads them from
disk instead of the classpath. This allows developers to edit browser-interpreted files and reload them without needing
to recompile source.This version is compatible with dropwizard 0.7.X.
## Maven Setup
```xml
com.bazaarvoice.dropwizard
dropwizard-configurable-assets-bundle
0.2.2```
## Getting Started
Implement the AssetsBundleConfiguration:
```java
public class SampleConfiguration extends Configuration implements AssetsBundleConfiguration {
@Valid
@NotNull
@JsonProperty
private final AssetsConfiguration assets = new AssetsConfiguration();@Override
public AssetsConfiguration getAssetsConfiguration() {
return assets;
}
}
```Add the redirect bundle:
```java
public class SampleService extends Application {
public static void main(String[] args) throws Exception {
new SampleService().run(args);
}@Override
public void initialize(Bootstrap bootstrap) {
bootstrap.addBundle(new ConfiguredAssetsBundle("/assets/", "/dashboard/"));
}@Override
public void run(SampleConfiguration configuration, Environment environment) {
...
}
}
```A sample local development config:
```yml
assets:
overrides:
/dashboard: src/main/resources/assets/
mimeTypes:
woff: application/font-woff
```You can override multiple external folders with a single configuration in a following way:
```yml
assets:
overrides:
/dashboard/assets: /some/absolute/path/with/assets/
/dashboard/images: /some/different/absolute/path/with/images
```