Rest API

0
0

Hi,

do you have any working example ApiController inside wisej web application? I have searched around but nothing work for me, even Nancy library.

Thank for your help,

Page

  • You must to post comments
0
0

You have to tell ASP.NET WebApi (or Nancy – which is abandoned now) to ignore *.wx requests. Otherwise their api router takes over. With ASP.NET WebApi simply add this to RouteConfig.RegisterRoutes:

public static void RegisterRoutes(RouteCollection routes)
{
  routes.IgnoreRoute("{*.wx}");  // <-  ADD THIS
  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

  routes.MapRoute(
     name: "Default",
     url: "{controller}/{action}/{id}",
     defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  );
 }

 

  • Tom Van den Eynde
    What would be the approach when using WiseJ in combination with ASP.NET Core Web API (which doesn’t seem to have RegisterRoutes)?
  • Luca (ITG)
    Registered routes are a feature of ASP.NET. Wisej has nothing to do with that, it’s just one of the many middlewares registered in Startup.cs. You can map any api to any route using the standard calls in ASP.NET core. There are several options in msdn.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.