Last active
April 29, 2017 21:30
-
-
Save hlaueriksson/7ceeded33ebe530c3456a03ba15ee489 to your computer and use it in GitHub Desktop.
2017-04-30-serverless-with-azure-functions
This file contains 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
{ | |
"disabled": false, | |
"bindings": [ | |
{ | |
"authLevel": "anonymous", | |
"name": "req", | |
"type": "httpTrigger", | |
"direction": "in", | |
"route": "query/{queryName}", | |
"methods": [ | |
"post" | |
] | |
}, | |
{ | |
"name": "$return", | |
"type": "http", | |
"direction": "out" | |
} | |
] | |
} |
This file contains 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
{ | |
"frameworks": { | |
"net46":{ | |
"dependencies": { | |
"CommandQuery.AzureFunctions": "0.2.0" | |
} | |
} | |
} | |
} |
This file contains 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
#r "Latest.dll" | |
using System.Net; | |
using System.Reflection; | |
using CommandQuery.AzureFunctions; | |
static QueryFunction func = new QueryFunction(Assembly.Load("Latest").GetQueryProcessor()); | |
public static async Task<HttpResponseMessage> Run(string queryName, HttpRequestMessage req, TraceWriter log) | |
{ | |
return await func.Handle(queryName, req, log); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment