diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..12cccc2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.cs] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index 509668d..3a0e02b 100644 --- a/.gitignore +++ b/.gitignore @@ -303,3 +303,5 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ + +.vscode diff --git a/Controllers/ValuesController.cs b/Controllers/ValuesController.cs deleted file mode 100644 index 115e0d6..0000000 --- a/Controllers/ValuesController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace GitHubAutoresponder.Controllers -{ - [Route("api/[controller]")] - public class ValuesController : Controller - { - // GET api/values - [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody]string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody]string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/GitHubAutoresponder.csproj b/GitHubAutoresponder.csproj index 60ee45b..27319db 100644 --- a/GitHubAutoresponder.csproj +++ b/GitHubAutoresponder.csproj @@ -10,6 +10,8 @@ + + diff --git a/Program.cs b/Program.cs index 7079b5e..1780639 100644 --- a/Program.cs +++ b/Program.cs @@ -1,25 +1,22 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace GitHubAutoresponder -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHost(args).Run(); - } - - public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup() - .Build(); - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace GitHubAutoresponder { + public class Program { + public static void Main(string[] args) { + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + } +} diff --git a/Startup.cs b/Startup.cs index bc47b1d..1c77acb 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,40 +1,34 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace GitHubAutoresponder -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseMvc(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace GitHubAutoresponder { + public class Startup { + public Startup(IConfiguration configuration) { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) { + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + + app.UseMvc(); + } + } +} diff --git a/Webhook/Payload.cs b/Webhook/Payload.cs new file mode 100644 index 0000000..3516242 --- /dev/null +++ b/Webhook/Payload.cs @@ -0,0 +1,5 @@ +namespace GitHubAutoresponder.Webhook { + class Payload { + + } +} diff --git a/Webhook/WebhookController.cs b/Webhook/WebhookController.cs new file mode 100644 index 0000000..e09aa52 --- /dev/null +++ b/Webhook/WebhookController.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace GitHubAutoresponder.Webhook { + [Route("api/[controller]")] + public class WebhookController : Controller { + [HttpGet] + public IEnumerable Get() { + return new string[] { "value1", "value2" }; + } + + [HttpGet("{id}")] + public string Get(int id) { + return "value"; + } + + [HttpPost] + public void Post([FromBody]string value) { + + } + + [HttpPut("{id}")] + public void Put(int id, [FromBody]string value) { + + } + + [HttpDelete("{id}")] + public void Delete(int id) { + + } + } +}