Last active
May 23, 2018 07:44
-
-
Save GrillPhil/5162fa49d09415fd5ce55eff17eef1fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.Azure.WebJobs.Extensions.SignalRService; | |
using Microsoft.Azure.WebJobs.Host; | |
namespace ServerlessRealtimeDemo | |
{ | |
public static class NegotiateFunction | |
{ | |
[FunctionName("negotiate")] | |
public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")]HttpRequest req, | |
[SignalRConnectionInfo(HubName = "broadcast")]AzureSignalRConnectionInfo info, | |
TraceWriter log) | |
{ | |
return info != null | |
? (ActionResult)new OkObjectResult(info) | |
: new NotFoundObjectResult("Failed to load SignalR Info."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment