quarta-feira, 5 de Julho de 2017 às 18:57:22 UTC-3, Douglas Patriarche
escreveu:
>
> Hi Flavio,
>
> Yes, that sounds like a sane structure for organizing assets. If you are
> using Maven to manage your project, then your web-visible assets should be
> under the <project>/src/main/resources directory, e.g.:
>
> <project>/src/main/resources/assets/js
> <project>/src/main/resources/assets/css
> <project>/src/main/resources/assets/html
>
>
> You can then configure your application to serve static assets using
> a ConfiguredAssetsBundle like this:
>
> public class MyApplication extends Application<MyAppConfiguration> {
> // ...
> @Override
> public void initialize(final Bootstrap<MyAppConfiguration> bootstrap)
> {
> bootstrap.addBundle(new ViewBundle<>());
> bootstrap.addBundle(new ConfiguredAssetsBundle("/assets/",
> "/assets/", "index.html", "assets"));
> bootstrap.addBundle(new ConfiguredAssetsBundle(
> "/META-INF/resources/webjars", "/webjars", "index.html", "webjars"));
> }
> // ...
> }
>
> You can configure multiple ConfiguredAssetsBundles, as seen above. The
> second instance allows you to add WebJars <http://www.webjars.org> for
> almost any JS/CSS library you might need.
>
> For a Metrics UI, I suggest you have a look at Grafana
> <https://grafana.com> (for the UI) and Graphite
> <https://github.com/graphite-project/graphite-web> (for the back-end
> metrics service). To install Graphite, following the instructions here
> <https://community.rackspace.com/products/f/25/t/6800>. Then install
> Grafana, following the instructions here
> <http://docs.grafana.org/installation/debian/>.
>
> I hope this helps.
>
> Regards,
> Doug
>
Hi Douglas, thanks for your explanations!
So the first line would be to tell Dropwizard that my resourcePath is
/assets/, my uriPath is also /assets/, my indexFile is index.html and my
assetsName is assets as seen
here:
https://github.com/dropwizard-bundles/dropwizard-configurable-assets-bundle/blob/master/src/main/java/io/dropwizard/bundles/assets/ConfiguredAssetsBundle.java#L173
Is my assumption correct?
About the second line, I would have to create directories
/META-INF/resources/webjars inside /assets/ to have my webjars in
/webjars/, again, am I following this through?
In regards to Metrics UI, I have an idea for a Metrics UI that would be
easily integrated to Dropwizard and maybe in the future be part of the
bundle package, without depending on 3rd party software and its
dependencies.
That's why I would like to know more about what is already there and where
to see the possibility of extending and customizing it.
Regards,
Flavio Silveira
--
You received this message because you are subscribed to the Google Groups
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.