I am trying to create a simple function that will take a parameter on the get and return a list of categories based on that parameter.
However, I cannot find any useful documentation about routing or passing through parameters so this is what I have - I just need a pointer in how to access the website parameter (and if the route is correct)
public static class GetCategoriesCRUDFunction
{
[FunctionName("CategoriesFunction")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "{website}")]HttpRequestMessage request, TraceWriter log) // is this how to set up a route or do I need to do attribute routing?
{
IService service = new Service();
var categories = await service.GetCategories(website); // how do I get this website parameter from the querystring - do I need to use something like httpcontext?
return request.CreateResponse(HttpStatusCode.OK, categories);
}
}