-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathProgram.cs
34 lines (31 loc) · 1.29 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using Microsoft.AspNet.WebHooks.Config;
using Microsoft.AspNet.WebHooks.Services;
using Microsoft.Owin.Hosting;
namespace MailChimpReceiver.Selfhost
{
internal class Program
{
public static void Main(string[] args)
{
string baseAddress = "http://localhost:50008/";
// Start OWIN host
using (WebApp.Start<Startup>(url: baseAddress))
{
string mailChimpAddress = GetWebHookAddress(baseAddress);
Console.WriteLine("Starting MailChimp WebHooks receiver running on " + mailChimpAddress);
Console.WriteLine("For non-localhost requests, use of 'https' is required!");
Console.WriteLine("For more information about MailChimp WebHooks, please see 'https://apidocs.mailchimp.com/webhooks/'");
Console.WriteLine("Hit ENTER to exit!");
Console.ReadLine();
}
}
private static string GetWebHookAddress(string baseAddress)
{
SettingsDictionary settings = CommonServices.GetSettings();
string code = settings["MS_WebHookReceiverSecret_MailChimp"];
string address = baseAddress + "api/webhooks/incoming/mailchimp?code=" + code;
return address;
}
}
}