Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tobbe 81 posts 387 karma points c-trib
    Jan 12, 2015 @ 11:33
    Tobbe
    0

    Custom API controller/route

    I have a normal Umbraco site with some company info. On this site Im about to create a web app (angularjs) that gonna use an API from another domain. Since I wont be able to get stuff from the other domain (CORS), what is the best way to create an API on the Umbraco site that gets data from the other domain and makes it accessible to my web app with ajax calls.

    Example: In my webapp (www.mysite.com) I want to get all products from (api.somedomain.com/products). I want to be able to do an ajax call to www.mysite.com/api/products and that should call a controller that returns products from api.somedomain.com/products.

    I wont need to return any umbraco content so I dont know if UmbracoApiController is the way to go?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 12, 2015 @ 12:12
    Jeroen Breuer
    0

    I think the UmbracoApiController is still a good idea because that will handle the routing for you. More info: http://our.umbraco.org/documentation/Reference/WebApi/

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft