Hello,
How to create a Web api (like asp.net api controllers) in a wisej app?
If this is not supported by default what is the best approach?
thanks…
Hi Ali,
For my education, why would you want to create a Web Api in the Wisej application? Why not create a separate application for that?
Best,
Alex
Hi Ali,
If you’re using .NET Core you can use Simple APIs. Add this to Startup.cs:
app.MapGet("/data", () => { var random = new Random(); var data = new List<dynamic>(); for (var i = 0; i < 10; i++) { data.Add(new { index = i, value = random.Next(10000) }); } return JSON.Stringify(data); });
If you’re using .NET Framework you can register an IHttpModule, see this link for a demo that shows an implementation:
https://github.com/iceteagroup/wisej-extensions/tree/2.2/Wisej.Web.Ext.OfficeViewer
Best,
Levie
Please login first to submit.