2019-06-25 09:49:52 +02:00
|
|
|
package sonia.scm.lifecycle.modules;
|
2018-10-23 16:28:53 +02:00
|
|
|
|
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
|
import com.google.inject.servlet.ServletModule;
|
|
|
|
|
import org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
2019-06-24 16:59:28 +02:00
|
|
|
/**
|
|
|
|
|
* Module to configure resteasy with guice.
|
|
|
|
|
*/
|
2018-10-23 16:28:53 +02:00
|
|
|
public class ResteasyModule extends ServletModule {
|
|
|
|
|
@Override
|
|
|
|
|
protected void configureServlets() {
|
|
|
|
|
Map<String, String> initParams = ImmutableMap.of(ResteasyContextParameters.RESTEASY_SERVLET_MAPPING_PREFIX, "/api");
|
2019-06-24 16:59:28 +02:00
|
|
|
serve("/api/*").with(ResteasyAllInOneServletDispatcher.class, initParams);
|
2018-10-23 16:28:53 +02:00
|
|
|
}
|
|
|
|
|
}
|