The Saturn App Template is best developed with Visual Studio Code or Visual Studio 2019 (Community works).
https://saturnframework.org/docs/
http://kcieslak.io/Reinventing-MVC-for-web-programming-with-F
This is for pure F# web applications and should be preferred over the original web app template.
Here is a list of the possible target frameworks. https://docs.microsoft.com/en-us/dotnet/standard/frameworks
- Example CAS setup
- Examples of an access restricted application using two routes
- Logged In View
- Default View
- Examples cookies setup where you can plug in EDS requests to get membership and other user details
Make sure you have .NET Core 3.1 SDK installed
- Clone me
- Add a hostname
saturn.local
127.0.0.1
- Add an environment variable. This will tell ASP.NET Core that you want to use Development settings
- key: ASPNETCORE_ENVIRONMENT
- value: Development
- Copy appsettings.json and rename it to appsettings.Development.json
- DO NOT PUT SENSITIVE SECRET SETTINGS IN appsettings.json. ONLY PUT SETTINGS IN appsettings.Development.json. NEVER COMMIT appsettings.Development.json
- You do not need to change the settings to get the app to run. Only do this when you use the temaple to build a real application.
- Install paket
dotnet tool install paket
dotnet tool restore
- Install fake
dotnet tool install fake-cli
dotnet tool restore
- Run the build and launch the app
- In
cmd
go to the root of the application. - Do
dotnet fake build target Run
- The app should launch in a browser
- In
Running the app with the build script
(fake)
will start it inwatch
mode. This means that as you make and save changes to the application,dotnet
will automatically rebuild and restart the application. Look in the shell logs to see when a build has been restarted and completed. At that point you can refresh the application in the browser and those changes will be included. If there are build errors, the build restart will fail and you will not be able to connect to the app in the browser. Look at the build log in the shell and fix the errors.
dotnet fake build target Build
See build.fsx
for for how the Test
build target works.
dotnt fake build target Test
See the build script build target Deploy
to see how this works.
This will work best from TeamCity, but you can test the build script and make sure the app files can be uploaded to Azure.
To get this working locally you will need to add an environment variable -- make it available system wide.
Environment variable name
AZURE_DEPLOY_PASSSWORD
The value will be the FTP deploy password created in the portal
How to create deployment credentials
The Deploy build target creates published files in the folder
deploy
. By default it will copyappsettings.json
file to the deploy folder. Since the settings will not be configured, the app will not run properly when deployed -- use with caution.
See the paket.dependencies file for all testing libraries
- Excpecto
- TickSpec for BDD https://github.com/fsprojects/TickSpec
- Canopy for UI tests https://lefthandedgoat.github.io/canopy/
By default this template will run as self-hosted using Kestrel, but you can host on IIS too.
- Add a site to IIS and point it to the WebHost folder
- Configure the bindings to whatever port you want to run it on. The template uses 8085.
- Configure the Application Pool to use No Managed Code
The above steps will get you there but instead of pointing to the WebHost folder, use Visual Studio or dotnet publish
to create a published site and use that in IIS. You will need to copy over the appsettings.Development.json file manually.
See the Setup and Configuration section of this Confluence page https://confluence.arizona.edu/display/COMT/MedSRP+Azure+Architecture