The PowerServer Web APIs is created during the build & deploy process and are ready to compile and run immediately after deployment.
Note
The Compile & Run Web APIs button () in the toolbar can only compile and run the Web APIs on the LOCAL machine, and detailed logs will be generated for development and debugging purpose. For optimal runtime performance, you can publish Web APIs to the dedicated server instead of running Web APIs locally.
To compile and run the Web APIs on the local machine:
-
Make sure your computer can connect to the NuGet site (https://www.nuget.org), so that the packages required for compiling and running the Web APIs can be successfully downloaded from the NuGet site.
-
Click the Compile & Run Web APIs button () in the toolbar.
-
Select whether to compile the PowerServer C# solution before running the Web APIs (it is selected by default).
For the first time to run the Web APIs, the compile option must be selected. After the successful compiling and running of Web APIs, this option can be de-selected to save time, unless the Web APIs project has been changed or an error has occurred.
-
Select the DB connection profile that the Web API will work with. The DB connection profile that is currently selected in the Database Configuration window will be selected by default.
-
Click OK to compile and run the Web APIs.
-
Check the Output window and make sure build is successful.
-
Make sure the API console window displays "Application started...". Also notice "Now listening on: http://0.0.0.0:5009" in the console window. This is the URL for accessing the Web APIs. The port number can be modified in the ServerAPIs\Properties\launchSettings.json in the PowerServer C# solution.
When the installable cloud application is run later, you can view the logs in the console window to check if the requests and responses are processed successfully.
To compile and run the Web APIs on the dedicated server:
Refer to Tutorial 2: Hosting Web APIs in Docker Containers for how to deploy the PowerServer Web APIs to Docker.
Refer to Tutorial 3: Hosting Web APIs in IIS for how to deploy the PowerServer Web APIs to IIS.
Refer to Tutorial 4: Hosting Web APIs in Kestrel for how to run the PowerServer Web APIs on Kestrel.
Refer to Tutorial 11: Deploying installable cloud apps to Kubernetes for how to deploy the PowerServer Web APIs to Kubernetes.