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
On Wednesday, July 5, 2017 at 12:31:36 PM UTC-4, Flavio Silveira wrote:
>
> Good afternoon,
>
> I'm rather new to both Dropwizard and Java in general, but l've been
> wondering the recommended way of organizing UI elements in assets
> directory, can I use the JSP project structure for example?
>
> I want to use it together with VueJS, so I thought about something like:
>
> assets/js - for JavaScript files
> assets/css - for CSS files
> assets/html - for html files or something like that
>
> and so on.
>
> Does this sound sane to you?
>
> On another matter, if I wanted to create a better UI for metrics, where
> should I start looking?
>
> 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.