Specify the Web API URL

The Web API URL indicates the root URL of the PowerServer Web APIs, for example, https://172.16.10.10:5099. It is highly recommended that you specify an HTTPS URL for the production environment.

Using "localhost" is only appropriate for the development environment when the .NET server and the Web server are on the same machine. The best practice would be to specify the IP address or domain name of the .NET server no matter in the development environment or production environment.

Note

Exception: if you use a self-signed certificate in the development environment, the self-signed certificate will only work with "localhost" but NOT with IP address or domain name. For more, refer to Support HTTPS.

When deployed by the Build & Deploy PowerServer Project button, this URL will be deployed to the following areas:

  • The complete Web API URL will be deployed together with the app files to the Web server. The Web server will use this URL to access the PowerServer Web APIs when requests come in.

    To change the Web API URL on the Web server, you can either 1) change the Web API URL in the project painter and then deploy the project again; or 2) run the command-line tool (CustomizeDeploy.dll) on the Web server to modify the Web API URL. See this section for more details.

  • The port number in the Web API URL will be deployed to the PowerServer C# solution; so that when the PowerServer Web APIs starts in the development environment, it starts at this port number.

    The port number will be used only when PowerServer Web API starts in the local development environment.

    To change the port number in the solution, you can either 1) directly modify the port number in the PowerServer C# solution > ServerAPIs project > Properties > launchSettings.json > "applicationUrl" setting; or 2) change the port number in the project painter and then deploy the project again.

    Note that if you want to deploy the new port number from the project painter to an existing PowerServer C# solution, make sure the "Overwrite server settings (DB Connection, .NET server listening port, and license)" option is selected in the .NET Server page > Advanced tab, otherwise the port number in the solution will not get updated.