package com.simplerecipemanager;

import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

import com.bazaarvoice.dropwizard.assets.ConfiguredAssetsBundle;
import com.simplerecipemanager.configuration.SrmApiConfiguration;
import com.simplerecipemanager.health.ConnectionHealthCheck;
import com.simplerecipemanager.resources.HealthCheckResource;
import com.simplerecipemanager.resources.RecipesResource;
import com.simplerecipemanager.resources.SearchResource;
import com.simplerecipemanager.resources.TestResource;

public class SrmApiApplication extends Application<SrmApiConfiguration> {
	public static void main(String[] args) throws Exception {
		new SrmApiApplication().run(args);
	}

	@Override
	public void initialize(Bootstrap<SrmApiConfiguration> arg0) {
		arg0.addBundle(new ConfiguredAssetsBundle("/assets/", "/"));
	}

	@Override
	public void run(SrmApiConfiguration configuration, Environment environment)
			throws Exception {

		environment.jersey().setUrlPattern("/v1");
		final RecipesResource reipceResource = new RecipesResource(
				configuration.getMapperFactory().build(environment));
		environment.jersey().register(reipceResource);

		final SearchResource searchResource = new SearchResource(configuration
				.getCloudSearchFactory().buildNameSearch(environment));
		environment.jersey().register(searchResource);

		final ConnectionHealthCheck connHC = new ConnectionHealthCheck(
				configuration.getMapperFactory().build(environment));
		environment.healthChecks().register("Connection", connHC);

		final HealthCheckResource hcR = new HealthCheckResource(
				environment.healthChecks());
		environment.jersey().register(hcR);

		final TestResource test = new TestResource(configuration
				.getMapperFactory().build(environment));
		environment.jersey().register(test);

	}
}

@@ -1032,16 +1032,18 @@
 ern(%22/v1
+/*
 %22);%0A%09%09fi

Move api to /v1