Running Web APIs on Kestrel

As Kestrel is by default included and enabled in the PowerServer Web APIs, when the PowerServer Web APIs runs, it automatically runs on Kestrel.

You can run PowerServer Web APIs on Kestrel using the following methods:

  • (In the development environment) Launch the PowerServer Web APIs from the SnapDevelop IDE (by clicking the Run button in the PowerServer C# solution).

  • (In the development environment) Execute the "dotnet run --project PowerServer_salesdemo\ServerAPIs\ServerAPIs.csproj" command,

  • (In the production environment) Publish the PowerServer Web APIs from the SnapDevelop IDE to a folder, copy the folder to the production server, and then run the app.

    The Web APIs will be compiled as an ASP.NET Core app and all files (such as configuration files, assembly files, dependencies, .NET runtime etc.) required to run the app will be copied to the publish folder. See this section for step-by-step instructions on how to publish the Web APIs to a folder.

    After that, copy the folder to the server and then run the app:

    dotnet <app_assembly>.dll

    The PowerServer Web APIs can be run as a service just like any other ASP.NET Core app, so that it can be automatically run without needing you to log into the PC to start it.

    To run the PowerServer Web APIs as a service in Windows, refer to https://docs.microsoft.com/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-3.1&tabs=visual-studio.

    To run the PowerServer Web APIs as a service in Linux, refer to https://docs.microsoft.com/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-3.1#create-the-service-file.