Deployment: Difference between revisions
Admin>Soulmate mNo edit summary |
Admin>Soulmate m (→Prerequisites) |
||
Line 16: | Line 16: | ||
# Either install the MSI file or extract the Zip file to the Website root folder. | # Either install the MSI file or extract the Zip file to the Website root folder. | ||
# Alter bin/appsettings.json with `UseHttps: true` to enforce HTTPS. | # Alter bin/appsettings.json with `UseHttps: true` to enforce HTTPS. | ||
'''Remarks:''' | '''Remarks:''' | ||
Line 28: | Line 26: | ||
== Desktop App == | == Desktop App == | ||
The releases for desktop app are basically the same as the ones for Web App, however, the release is hosted in a local Web server Kestrel included in ASP.NET Runtime. | The releases for desktop app are basically the same as the ones for Web App, however, the release is hosted in a local Web server Kestrel included in ASP.NET Core Runtime. | ||
=== Windows === | === Windows === | ||
Line 46: | Line 44: | ||
# File `bin/appsettings.json`: Alter Kestrel/Endpoints/Http/Url to "[http://localhost:Port http://localhost:PortNotInUse]", for example, "[http://localhost http://localhost:5310"] | # File `bin/appsettings.json`: Alter Kestrel/Endpoints/Http/Url to "[http://localhost:Port http://localhost:PortNotInUse]", for example, "[http://localhost http://localhost:5310"] | ||
# File `StartPoetryApp.ps1`: Alter respective URL of start-process. | # File `StartPoetryApp.ps1`: Alter respective URL of "start-process". | ||
=== MacOS === | === MacOS === | ||
[[File:Local app on MacOS.png|thumb|local app on MacOS]] | |||
==== '''Prerequisites''' ==== | ==== '''Prerequisites''' ==== | ||
# [https://dotnet.microsoft.com/en-us/download/dotnet/6.0 ASP.NET Core Runtime] | # [https://dotnet.microsoft.com/en-us/download/dotnet/6.0 ASP.NET Core Runtime] for macOS Binaries Arm64 or x64 | ||
==== '''Installation''' ==== | ==== '''Installation''' ==== | ||
Line 64: | Line 63: | ||
'''Hints:''' | '''Hints:''' | ||
You may want to create [https://support.apple.com/en-au/guide/terminal/apdd100908f-06b3-4e63-8a87-32e71241bab4/2.12/mac/11.0 a shell script] to execute PoetryApp. | You may want to create [https://support.apple.com/en-au/guide/terminal/apdd100908f-06b3-4e63-8a87-32e71241bab4/2.12/mac/11.0 a shell script] to execute PoetryApp. For example:<syntaxhighlight lang="sh"> | ||
dotnet bin/PoetryApp.dll & | |||
sleep 2 | |||
open http://localhost:5300 | |||
</syntaxhighlight>And don't forget to [https://support.apple.com/en-au/guide/terminal/apdd100908f-06b3-4e63-8a87-32e71241bab4/2.12/mac/11.0 apply "chmod 755" to the sh file]. |
Revision as of 06:37, 11 October 2022
This page is for IT administers, Web masters and computer literates who have basic skills of deploying a Website. The files needed are available in the Download area.
During development, the frontend and the backend are often running on different hosts. Almost all features of the app could run well in such config, except the locally hosted pictures. The locally hosted pictures are using relative patch in img src
, and such constraint is good for static readonly deployment.
The backend and the fontend should be hosted in the same host. And the DB engine is with Sqlite.
Deploy to IIS
Prerequisites
- ASP.NET Core Runtime Hosting Bundle for Windows IIS.
- A Website created with Application Pool of "No Managed Code".
Installation
- Either install the MSI file or extract the Zip file to the Website root folder.
- Alter bin/appsettings.json with `UseHttps: true` to enforce HTTPS.
Remarks:
It may be beneficial to set a IIS rewrite rule in Web.config to further enforce HTTPS, while this is optional, since the app itself along with ASP.NET Core Runtime Hosting Bundle is capable of redirecting HTTP calls to HTTPS.
Hints:
If you don't want to purchase a SSL certificate, you may use "Let's Encrypt".
Desktop App
The releases for desktop app are basically the same as the ones for Web App, however, the release is hosted in a local Web server Kestrel included in ASP.NET Core Runtime.
Windows
Prerequisites
Installation
- Either install the MSI file or extract the Zip file to a desired folder.
- In folder, double clickâCreateShortcut.batâ which will create a shortcut on Windows desktop. This shortcut actually runs `StartPoetryApp.ps1` which will launch PoetryApp.exe and open the default Web browser browsing http://localhost:5300.
You can copy or move the shortcut to any launch area of Windows.
Hints:
In case you have other apps running at port 5300, you need to change the following settings:
- File `bin/appsettings.json`: Alter Kestrel/Endpoints/Http/Url to "http://localhost:PortNotInUse", for example, "http://localhost:5310"
- File `StartPoetryApp.ps1`: Alter respective URL of "start-process".
MacOS
Prerequisites
- ASP.NET Core Runtime for macOS Binaries Arm64 or x64
Installation
- Extract the Zip file to a desired folder, for example, "/Users/YourUsername/Documents/PoetryApp"
Execution
Terminal
- Under "/Users/YourUsername/Documents/PoetryApp", execute "dotnet bin/PoetryApp.dll". And this will launch Kestrel Web server hosting http://localhost:5300
- Open browser Safari or Chrome, and go to http://localhost:5300
Hints:
You may want to create a shell script to execute PoetryApp. For example:<syntaxhighlight lang="sh"> dotnet bin/PoetryApp.dll & sleep 2 open http://localhost:5300 </syntaxhighlight>And don't forget to apply "chmod 755" to the sh file.