Beispiel #1
0
        private void Setup()
        {
            handler = new DetergentRestHttpHandler();
            SimpleRestRequestRouter router = new SimpleRestRequestRouter();
            handler.RequestRouter = router;

            SampleRestService service = new SampleRestService();
            service.ConfigureRoutes(router);
        }
        private void Setup()
        {
            httpHandler = new DetergentRestHttpHandler();
            listener = new DetergentHttpListener(
                "http://localhost:9999",
                "/service",
                httpHandler);

            SimpleRestRequestRouter router = new SimpleRestRequestRouter();
            httpHandler.RequestRouter = router;

            SampleRestService service = new SampleRestService();
            service.ConfigureRoutes(router);
        }
Beispiel #3
0
 public void ConfigureRoutes(SimpleRestRequestRouter router)
 {
     router.AddRoute(HttpMethod.GET, "packages$", ListPackages);
     router.AddRoute(HttpMethod.GET, "package/(?<id>[^//]+)$", GetPackage);
 }