示例#1
0
        static void Main(string[] args)
        {
            const string address  = "https://webapibook.servicebus.windows.net/nancy/";
            var          sbConfig = new AzureServiceBusOwinServiceConfiguration(
                issuerName: "owner",
                issuerSecret: SecretCredentials.Secret,
                address: address);
            var server = AzureServiceBusOwinServer.Create(sbConfig, app =>
            {
                app.UseNancy();
            });

            Console.WriteLine("Server is listening at {0}", address);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string address = SecretCredentials.ServiceBusAddress;

            var sbConfig = new AzureServiceBusOwinServiceConfiguration(
                issuerName: SecretCredentials.PolicyName,
                issuerSecret: SecretCredentials.Secret,
                address: address);
            var server = AzureServiceBusOwinServer.Create(sbConfig, app =>
            {
                app.UseNancy();
            });

            Console.WriteLine("Server is listening at {0}", address);
            Console.ReadKey();
        }
        public IntegrationTests()
        {
            var sbConfig = new AzureServiceBusOwinServiceConfiguration(
                issuerName: "owner",
                issuerSecret: SecretCredentials.Secret,
                address: SecretCredentials.ServiceBusAddress);

            _server = AzureServiceBusOwinServer.Create(sbConfig, app =>
            {
                var config = new HttpConfiguration();
                config.Routes.MapHttpRoute("ApiDefault", "webapi/{controller}/{id}", new { id = RouteParameter.Optional });

                app.Use((ctx, next) =>
                {
                    Trace.TraceInformation(ctx.Request.Uri.ToString());
                    return(next());
                });
                app.UseWebApi(config);
            });
        }
        public IntegrationTests()
        {
            var sbConfig = new AzureServiceBusOwinServiceConfiguration(
                issuerName: "owner",
                issuerSecret: SecretCredentials.Secret,
                address: SecretCredentials.ServiceBusAddress);
            _server = AzureServiceBusOwinServer.Create(sbConfig, app =>
            {
                var config = new HttpConfiguration();
                config.Routes.MapHttpRoute("ApiDefault", "webapi/{controller}/{id}", new { id = RouteParameter.Optional });

                app.Use((ctx, next) =>
                {
                    Trace.TraceInformation(ctx.Request.Uri.ToString());
                    return next();
                });
                app.UseWebApi(config);
            });
        }