Skip to content

Instantly share code, notes, and snippets.

@runceel
Created September 26, 2019 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runceel/5b6d3a78ac9e3a2bb7cbfb5467b9dc49 to your computer and use it in GitHub Desktop.
Save runceel/5b6d3a78ac9e3a2bb7cbfb5467b9dc49 to your computer and use it in GitHub Desktop.
namespace TechSummit2018.ServerlessSmartSpeaker
{
public class SmartSpeakerEndpoints
{
private IAssistant Assistant { get; }
private IPlatformService PlatformService { get; }
public SmartSpeakerEndpoints(IAssistant assistant, IPlatformService platformService)
{
Assistant = assistant;
PlatformService = platformService;
}
[FunctionName("xplatvui")]
public async Task<IActionResult> Line(
[HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req, ILogger log)
{
var platform = await PlatformService.DetectPlatformAsync(req);
var response = await Assistant.RespondAsync(req, platform);
return new OkObjectResult(platform.ToPlatformResponse(response, platform));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment