All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webpiecesxxxxxpackage.json.JsonRoutes Maven / Gradle / Ivy

Go to download

Someone forgot to fill this in. See http://stackoverflow.com/questions/38272550/how-to-fail-the-gradle-build-if-subproject-is-missing-a-property

There is a newer version: 2.1.28
Show newest version
package webpiecesxxxxxpackage.json;

import static org.webpieces.ctx.api.HttpMethod.GET;
import static org.webpieces.ctx.api.HttpMethod.POST;
import static org.webpieces.router.api.routes.Port.BOTH;

import org.webpieces.router.api.routebldr.DomainRouteBuilder;
import org.webpieces.router.api.routebldr.RouteBuilder;
import org.webpieces.router.api.routes.Routes;

public class JsonRoutes implements Routes {

	@Override
	public void configure(DomainRouteBuilder domainRouteBldr) {
		RouteBuilder bldr = domainRouteBldr.getAllDomainsRouteBuilder();
		
		
		bldr.addStreamRoute(BOTH, POST, "/json/streaming", "JsonController.myStream", JsonRouteId.STREAMING_ROUTE);
		
		bldr.addContentRoute(BOTH, GET , "/json/read",         "JsonController.readOnly");

		bldr.addContentRoute(BOTH, GET , "/json/{id}",         "JsonController.jsonRequest", JsonRouteId.READ);
		bldr.addContentRoute(BOTH, POST , "/json",        "JsonController.postJson");

		bldr.addContentRoute(BOTH, GET , "/json/async/{id}",   "JsonController.asyncJsonRequest");
		bldr.addContentRoute(BOTH, POST, "/json/async/{id}",   "JsonController.postAsyncJson");

		bldr.addContentRoute(BOTH, GET , "/json/throw/{id}",        "JsonController.throwNotFound");

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy