@@ -0,0 +1,2961 @@
+package ch.fihlon.moodini;%0A%0Aimport ch.fihlon.moodini.business.question.boundary.QuestionsResource;%0Aimport com.codahale.metrics.MetricRegistry;%0Aimport com.codahale.metrics.health.HealthCheckRegistry;%0Aimport com.fasterxml.jackson.annotation.JsonInclude.Include;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport com.fasterxml.jackson.databind.SerializationFeature;%0Aimport com.fasterxml.jackson.datatype.guava.GuavaModule;%0Aimport com.fasterxml.jackson.datatype.jdk8.Jdk8Module;%0Aimport com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;%0Aimport com.google.inject.AbstractModule;%0Aimport com.google.inject.Guice;%0Aimport com.google.inject.Injector;%0Aimport io.dropwizard.Application;%0Aimport io.dropwizard.assets.AssetsBundle;%0Aimport io.dropwizard.lifecycle.setup.LifecycleEnvironment;%0Aimport io.dropwizard.setup.Bootstrap;%0Aimport io.dropwizard.setup.Environment;%0A%0Aimport javax.validation.constraints.NotNull;%0A%0Apublic class MoodiniApplication extends Application%3CMoodiniConfiguration%3E %7B%0A%0A    public static void main(@NotNull final String... args) %7B%0A        try %7B%0A            new MoodiniApplication().run(args);%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void initialize(@NotNull final Bootstrap%3CMoodiniConfiguration%3E bootstrap) %7B%0A        bootstrap.addBundle(new AssetsBundle(%22/webapp%22, %22/%22, %22index.html%22, %22webapp%22));%0A        bootstrap.addBundle(new AssetsBundle(%22/apidocs%22, %22/apidocs%22, %22index.html%22, %22apidocs%22));%0A    %7D%0A%0A    @Override%0A    public void run(@NotNull final MoodiniConfiguration configuration,%0A                    @NotNull final Environment environment) %7B%0A        registerModules(environment.getObjectMapper());%0A        final Injector injector = createInjector(configuration, environment);%0A        final QuestionsResource questionsResource = injector.getInstance(QuestionsResource.class);%0A        environment.jersey().register(questionsResource);%0A    %7D%0A%0A    private static void registerModules(@NotNull final ObjectMapper objectMapper) %7B%0A        objectMapper.registerModule(new Jdk8Module());%0A        objectMapper.registerModule(new JavaTimeModule());%0A        objectMapper.registerModule(new GuavaModule());%0A        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);%0A        objectMapper.setSerializationInclusion(Include.NON_ABSENT);%0A    %7D%0A%0A    private Injector createInjector(@NotNull final MoodiniConfiguration configuration, @NotNull final Environment environment) %7B%0A        return Guice.createInjector(new AbstractModule() %7B%0A            @Override%0A            protected void configure() %7B%0A                bind(MoodiniConfiguration.class).toInstance(configuration);%0A                bind(HealthCheckRegistry.class).toInstance(environment.healthChecks());%0A                bind(LifecycleEnvironment.class).toInstance(environment.lifecycle());%0A                bind(MetricRegistry.class).toInstance(environment.metrics());%0A            %7D%0A        %7D);%0A    %7D%0A%0A%7D%0A

Create an initial application class