コード例 #1
0
 public async Task Invoke(HttpContext context)
 {
     if (context.Request.Path == $"/{_configuration.RoutePrefix}/event")
     {
         await Respond(context.Response, await _requestHandler.HandleEventRequest(context.Request, _configuration).ConfigureAwait(false)).ConfigureAwait(false);
     }
     else if (context.Request.Path == $"/{_configuration.RoutePrefix}/action")
     {
         await Respond(context.Response, await _requestHandler.HandleActionRequest(context.Request, _configuration).ConfigureAwait(false)).ConfigureAwait(false);
     }
     else if (context.Request.Path == $"/{_configuration.RoutePrefix}/options")
     {
         await Respond(context.Response, await _requestHandler.HandleOptionsRequest(context.Request, _configuration).ConfigureAwait(false)).ConfigureAwait(false);
     }
     else if (context.Request.Path == $"/{_configuration.RoutePrefix}/command")
     {
         await Respond(context.Response, await _requestHandler.HandleSlashCommandRequest(context.Request, _configuration).ConfigureAwait(false)).ConfigureAwait(false);
     }
     else
     {
         await _next(context).ConfigureAwait(false);
     }
 }
コード例 #2
0
 public Task <SlackResult> Options([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request) =>
 _requestHandler.HandleOptionsRequest(request, _endpointConfig);
コード例 #3
0
 public async Task <IActionResult> Options([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request)
 {
     return(SlackResponse(await _requestHandler.HandleOptionsRequest(request, _endpointConfig).ConfigureAwait(false)));
 }