Setting datasource url in upshot.js

184 Views Asked by At

I just watched an awesome presentation about Single Page App. I also looked at the sample code but couldn't figure out where we set WebApi url in upshot.

We set datasource here:

@(Html.UpshotContext(bufferChanges: true).DataSource<DataServiceController>(x => x.GetDeliveriesForToday()))

But how do I set the source URL for a different environment?

1

There are 1 best solutions below

0
mhu On

It will follow routes set up in your RouteConfig.cs / global.asax.cs:

routes.MapHttpRoute(
    "DataService", // Route name
    "api/DataService/{action}", // URL with parameters
    new { controller = "DataService" } // Parameter defaults
);