in my .net8 function app project, I copied the echo function into a new file:
namespace NAV.LocalService.Function.Api.Print
{
public class PrintServiceApi(IHttpExecutionContextFactory factory)
{
private readonly IHttpExecutionContextFactory _factory = factory ?? throw new ArgumentNullException(nameof(factory));
[Function(nameof(PrintServiceApi))]
[OpenApiOperation(nameof(PrintServiceApi), [Configuration.Constants.Default], Summary = "Endpoint for the Api")]
[OpenApiResponseWithBody(HttpStatusCode.OK, MediaTypeNames.Application.Json, typeof(string), Description = "Success")]
public async Task<ActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, HttpVerbs.Get, Route = "printservice")] HttpRequest req)
{
return await _factory.CreateContext(req).Execute(() =>
{
return Task.FromResult("läuft");
});
}
}
}
I changed very little, just the names and endpoint, and my endpoint is triggable via the route;
however, when I start my function app, the endpoint isnt displayed:
How can I add my endpoint to it? I was expecting this to work automatically ,but it didnt work.
thank you