Modifying the PowerServer project

The following modifications are made to the PowerServer project created in Quick Start > Guide 1. If you have not created a PowerServer project yet, please follow Quick Start > Guide 1 to create one.

Selecting the server profile

Select the Web server profile for the remote server (instead of the local server).

In the PowerServer project painter, select the Web Server page > Advanced tab, select Use this server and then select the server profile (such as "Remote IIS", "Remote Apache", or "Remote Nginx").

If you have not created the server profile for the remote server, follow the instructions in Creating a Web server profile for remote deployment.

Or if you want to select Create a package (instead of Use this server), then follow the instructions in Packaging and copying the client app.


Importing the production license

If you are deploying to a production server, you might want to use a production license for PowerServer, instead of using a developer license. To use a production license, you will need to export the license file from the Appeon website and then import the license to the PowerServer project.

Step 1: Log into the Appeon User Center, click License Management, and then click All Licenses under PowerServer.


Step 2: Click View, and then click Export to export the license code to a TXT file ([LicenseKey].txt) and save the file on the local machine.

Do not change the file name, as the file name represents the unique license key.


Step 3: Go to the .NET Server page of the PowerServer project painter, and then click Import From File to select and import the [LicenseKey].txt file.


Specifying the Web API URL

The Web API URL is used by the client app to call the Web APIs.

In the PowerServer project painter, select the .NET Server page > Basic tab, specify the Web API URL, for example, https://172.16.100.71:5009. This indicates that the client app will call the Web APIs running on the .NET server at https://172.16.100.71:5009.

It is highly recommended that you specify an HTTPS URL for the production environment.

Note

  1. Make sure the Web API is running on the specified IP address (or host name) and port number. For how to start the Web API, see the next section.

  2. If the IP address and port number of the .NET server are changed later, you will need to modify the settings here and then deploy the project again (using the "Deploy PowerServer Project" option).


Selecting the authentication template

It is strongly recommended for security concerns, that in the production environment, you shall safeguard the server resources through implementing an authentication server with PowerServer.


In the PowerServer project painter, select the .NET Server page > Basic tab, then select a template type from the Auth Template list.

  • Use built-in JWT server: Includes a built-in authentication server that supports JWT or bearer tokens. See Tutorial 6: Authenticating your apps > Using JWT for more information.

  • Use built-in OAuth server: Includes a built-in authentication server based on IdentityServer4 framework that works with the OAuth 2.0 authorization flows. See Tutorial 6: Authenticating your apps > Using OAuth 2.0 for more information.

  • Use built-in AWS Cognito server: Includes a built-in authentication server that works with the Amazon Cognito user pool. See Tutorial 6: Authenticating your apps > Using Amazon Cognito for more information.

  • Use external Azure Active Directory service: Includes templates that work with Azure AD or Azure AD B2C. See Tutorial 6: Authenticating your apps > Using Azure Active Directory for more information.

If you selected "Use external auth service", see Tutorial 6: Authenticating your apps > Using other auth servers for more information on how to incorporate the other auth servers that work with the OAuth flows or JWT, such as Okta OIDC (OpenID Connect).

Configuring the database connection

To connect with a remote database (instead of the local database), you will need to create a new database cache.

Step 1: In the PowerServer project painter, select the Database page > Advanced tab, then click New in the upper part to create the database connection.

Step 2: In the dialog box that displays, specify the settings for the database connection.

The following uses the PB demo database for SQL Anywhere as an example.

  1. Select SQL Anywhere (ODBC) from the Provider list.

  2. Specify "sales_remotedb" (or any text you like) as the database cache name in the Cache name field.

  3. Select the ODBC data source that connects with the remote database. The "SalesDemo DB" ODBC data source is created in Creating the ODBC data source.

  4. Specify "dba" as the user name and "sql" as the password.

Step 3: Select the option "I have read and agree to the license ...".

Step 4: Click Test connection to make sure the database can be connected successfully.


Step 5: Then select the database cache you created just now to map with the "sqlca" transaction object.


Selecting the Full build option

In the PowerServer project painter, select the Client App page > Basic tab, and make sure the Full build option is selected.

It is recommended that the Full build option should be selected when you build and deploy the project to the production environment.