package com.library.bookmanangement_library;
import org.codehaus.jackson.map.Module;
import com.library.bookmanangement_library.CustomJson;
import com.library.bookmanangement_library.config.LibraryServiceConfiguration;
import com.library.bookmanangement_library.resource.BookResource;
import com.library.bookmanangement_library.resource.LibraryResource;
import com.yammer.dropwizard.Service;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.json.Json;
public class LibraryService extends Service<LibraryServiceConfiguration> {
public static void main(String args[]) throws Exception
{
new LibraryService().run(args);
}
@Override
protected void initialize(LibraryServiceConfiguration configuration, Environment environment)
throws Exception {
environment.addResource(BookResource.class);
}
@Override
public Json getJson() {
final CustomJson json = new CustomJson();
for (Module module : getJacksonModules()) {
json.registerModule(module);
}
return json;
}
}