Warning
This sample app is under active development. Details and documentation will evolve over time.
This is a Kontent.ai sample ASP.NET Core MVC application running on .NET 8.
It is based on the Kontent.ai Ficto multisite project. Once finalized, it will supersede the existing, legacy .NET sample app.
Follow these steps to get the app running locally.
- .NET SDK 8.0 or newer
- A Kontent.ai Ficto multisite sample with:
- Environment ID
- (Optional) Preview API key
- (Optional) Secure Access API key
- Clone this repository:
git clone https://github.com/kontent-ai/sample-app-net-mvc.git
cd sample-app-net-mvc- Restore .NET dependencies:
dotnet restore-
Set your Kontent.ai environment ID in
appsettings.json:DeliveryOptions.EnvironmentId= your environment ID.
-
Optionally set preview or secure access keys:
Caution
While for sample app purposes, storing keys directly in appsettings.json doesn't present any major risk, even if accidentally committed, consider using local secrets as described below.
dotnet user-secrets init
dotnet user-secrets set "DeliveryOptions:PreviewApiKey" "your-preview-api-key"
dotnet user-secrets set "DeliveryOptions:SecureAccessApiKey" "your-secure-access-api-key"These values are kept in your local user profile and are not committed to the repository. They will become part of the corresponding DeliveryOptions section of appSettings.json during runtime.
Build the application:
dotnet buildRun the application:
dotnet runTo work on styles with automatic recompilation:
npm install
npm run devThis watches Styles/site.less and recompiles to wwwroot/css/site.css whenever you save changes.
TBD
For Contributing please see CONTRIBUTING.md for more information.
Distributed under the MIT License. See LICENSE.md for more information.