Kestrel is the default web server automatically installed and configured with ASP.NET Core. The Kestrel web server provides better request processing performance to ASP.NET Core applications as it is an open-source, cross-platform and light-weight web server; but it does not have advanced features of web servers like IIS, Nginx, Apache etc. For more details about Kestrel web server implementation in ASP.NET Core, see https://docs.microsoft.com/aspnet/core/fundamentals/servers/kestrel.
The ASP.NET Core project (in this case, the ServerAPIs project in the PowerServer C# solution > Properties > launchSettings.json file) configures how the built-in Kestrel starts by default in the local development environment.
-
"commandName" -- Specifies the web server to launch. Currently only "Project" is supported by PowerServer; it indicates the internal Kestrel web server will be launched.
-
"launchBrowser" -- Specifies whether to launch the PowerServer Web APIs in a web browser. This property is used when PowerServer Web APIs is run from SnapDevelop IDE, but not from PowerBuilder IDE.
-
"launchUrl" -- Specifies the default URL to be launched in the web browser. When it is set to "swagger", the Swagger UI will be launched automatically in the web browser. This property is used only when PowerServer Web APIs is run from SnapDevelop IDE (but not from PowerBuilder IDE).
-
"ASPNETCORE_ENVIRONMENT" -- Specifies the app's runtime environment. Currently only "Development" is supported by PowerServer.
-
"applicationUrl" -- Specifies the URL of the ASP.NET Core application (in this case, the PowerServer Web APIs); it is the host name and port number that Kestrel server listens on. The port number is initially from the value configured in PowerBuilder IDE (the port of local Kestrel server in PowerServer project painter, which is 5099 by default).
The "commandName", "ASPNETCORE_ENVIRONMENT" and "applicationUrl" properties will be used, when you run PowerServer Web APIs in the PowerBuilder IDE:
{ "profiles": { "ServerAPIs": { "commandName": "Project", "launchBrowser": true, "launchUrl": "PowerServer", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:5099/" } } }
Note
The launchSettings.json file is used only when you run PowerServer Web APIs and Kestrel in the local development environment, for example, when PowerServer Web APIs is directly run from the PowerBuilder IDE, SnapDevelop, VisualStudio, or by using .NET Core CLI. And this file will not be included when PowerServer Web APIs is published to the production server.
For more information about launchSettings.json, see https://docs.microsoft.com/aspnet/core/fundamentals/environments#development-and-launchsettingsjson.
Following outlines the key steps to deploy and run the PowerServer project using the built-in Kestrel (for detailed instructions, view this section):
-
In the PowerServer project painter, select the Deploy page > Basic tab, select Within the IDE and use the default settings of the local Kestrel server.
-
Click the Build & Deploy Project button in the toolbar to build and deploy the project.
-
Click the Run Project button in the toolbar.
The ServerAPIs project will be automatically compiled and run with the Kestrel web server in the local development host environment, listening to "localhost" and port 5099 by default; and the client app deployed to "wwwroot" under the ServerAPIs project will run automatically, using the same host name and port number.