Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            // Links to an Azure App Configuration resource that holds the app settings.
            // Set this in your visual studio Env Variables.
            var connectionString = Environment.GetEnvironmentVariable("APP_CONFIG_CONNECTION");

            CatalystWebHostBuilder
            .CreateWebHostBuilder <Startup, AppSettings>(args, connectionString)
            .Build()
            .Run();
        }
        public static void Main(string[] args)
        {
            // Links to an Azure App Configuration resource that holds the app settings.
            // For local development, set this in your visual studio Env Variables.
            var connectionString = Environment.GetEnvironmentVariable("APP_CONFIG_CONNECTION");

            CatalystWebHostBuilder
            .CreateWebHostBuilder <Startup, AppSettings>(args, connectionString)
            // If not using Azure App Configuration, remove the line above and bind AppSettings as you choose.
            // .CreateWebHostBuilder<Startup, AppSettings>(args)
            .Build()
            .Run();
        }
Exemplo n.º 3
0
        //[Test]
        //public async Task can_disambiguate_webhook() {
        //	var payload = new {
        //		Route = "v1/buyers/{buyerID}/addresses/{addressID}",
        //		Verb = "PUT",
        //		Request = new { Body = new { City = "Minneapolis" } },
        //		ConfigData = new { Foo = "blah" }
        //	};

        //	//var json = JsonConvert.SerializeObject(payload);
        //	//var keyBytes = Encoding.UTF8.GetBytes("myhashkey");
        //	//var dataBytes = Encoding.UTF8.GetBytes(json);
        //	//var hash = new HMACSHA256(keyBytes).ComputeHash(dataBytes);
        //	//var base64 = Convert.ToBase64String(hash);

        //	dynamic resp = await CreateServer()
        //		.CreateFlurlClient()
        //		.Request("demo/webhook")
        //		.WithHeader("X-oc-hash", "4NPw1O9AviSOC1A3C+HqkDutRLNwyABneY/3M2OqByE=")
        //		.PostJsonAsync(payload)
        //		.ReceiveJson();

        //	Assert.AreEqual(resp.Action, "HandleAddressSave");
        //	Assert.AreEqual(resp.City, "Minneapolis");
        //	Assert.AreEqual(resp.Foo, "blah");
        //}

        private TestServer CreateServer()
        {
            return(new TestServer(CatalystWebHostBuilder.CreateWebHostBuilder <TestStartup>(new string[] { })));
        }
Exemplo n.º 4
0
 public static void Main(string[] args)
 {
     CatalystWebHostBuilder.CreateWebHostBuilder <Startup>(args).Build().Run();
 }