EndpointSelector

Used to get URLs that vary in a locally running application and the application running on production.

Type:

Object

Create an instance of the EndpointSelector object passing a configuration object of a specific structure as a parameter.

JavaScript
var endpointSelector = new DevExpress.EndpointSelector(Application1.config.endpoints);
JavaScript
Application1.config.endpoints: {
    variant1: {
        local: "",
        production: ""
    },
    variant2: {
        local: "",
        production: ""
    },
    ...
}

As you can see in the code above, you can specify several pairs of links. Each of these pairs includes a link for a locally running application and a link for the application running in production mode. Fields for these pairs can be named as you like.

NOTE
You can use a JSON format for the configuration object.

To get a URL, use the urlFor method of your EndpointSelector instance passing the name of the required links variant as a parameter. The method will return a local or a productional URL depending on how the application is currently running.

Methods

This section describes methods of the EndpointSelector object.