From 2a6ef9277f21048c5ce00535a7ec8de94fbe25e0 Mon Sep 17 00:00:00 2001 From: nikolajlauridsen Date: Thu, 14 Nov 2024 12:25:41 +0100 Subject: [PATCH 1/2] Update enabling delivery api --- .../reference/content-delivery-api/README.md | 22 +++++++++++++++++++ .../reference/content-delivery-api/README.md | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/14/umbraco-cms/reference/content-delivery-api/README.md b/14/umbraco-cms/reference/content-delivery-api/README.md index 99665809572..0dbb86c32a5 100644 --- a/14/umbraco-cms/reference/content-delivery-api/README.md +++ b/14/umbraco-cms/reference/content-delivery-api/README.md @@ -14,9 +14,19 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ### Enable the Content Delivery API +You can enable the Delivery API when creating you project initially by using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. + +```bash +dotnet new umbraco -n MyProject -da +``` + +Yuo can also enable it after the fact with the following steps: + 1. Open your project's `appsettings.json`. 2. Insert the `DeliveryApi` configuration section under `Umbraco:CMS`. 3. Add the `Enabled` key and set its value to `true`. +4. Open `Program.Cs` +5. Add `.AddDeliveryApi()` to `builder.CreateUmbracoBuilder()` {% code title="appsettings.json" %} ```json @@ -32,6 +42,18 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ``` {% endcode %} +{% code title="Program.cs" %} +```csharp +builder.CreateUmbracoBuilder() + .AddBackOffice() + .AddWebsite() + .AddDeliveryApi() + .AddComposers() + .Build(); + +``` +{% endcode %} + Once the Content Delivery API is enabled, the next step is to rebuild the Delivery API content index (_DeliveryApiContentIndex_). This can be done using the **Examine Management** dashboard in the **Settings** section of the Umbraco Backoffice. 1. Access the Umbraco Backoffice. diff --git a/15/umbraco-cms/reference/content-delivery-api/README.md b/15/umbraco-cms/reference/content-delivery-api/README.md index 99665809572..0dbb86c32a5 100644 --- a/15/umbraco-cms/reference/content-delivery-api/README.md +++ b/15/umbraco-cms/reference/content-delivery-api/README.md @@ -14,9 +14,19 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ### Enable the Content Delivery API +You can enable the Delivery API when creating you project initially by using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. + +```bash +dotnet new umbraco -n MyProject -da +``` + +Yuo can also enable it after the fact with the following steps: + 1. Open your project's `appsettings.json`. 2. Insert the `DeliveryApi` configuration section under `Umbraco:CMS`. 3. Add the `Enabled` key and set its value to `true`. +4. Open `Program.Cs` +5. Add `.AddDeliveryApi()` to `builder.CreateUmbracoBuilder()` {% code title="appsettings.json" %} ```json @@ -32,6 +42,18 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ``` {% endcode %} +{% code title="Program.cs" %} +```csharp +builder.CreateUmbracoBuilder() + .AddBackOffice() + .AddWebsite() + .AddDeliveryApi() + .AddComposers() + .Build(); + +``` +{% endcode %} + Once the Content Delivery API is enabled, the next step is to rebuild the Delivery API content index (_DeliveryApiContentIndex_). This can be done using the **Examine Management** dashboard in the **Settings** section of the Umbraco Backoffice. 1. Access the Umbraco Backoffice. From 697e44a1d80a029bdd77f60dfa6bea67b7c4bb15 Mon Sep 17 00:00:00 2001 From: Mole Date: Thu, 14 Nov 2024 13:10:04 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: sofietoft --- 14/umbraco-cms/reference/content-delivery-api/README.md | 4 ++-- 15/umbraco-cms/reference/content-delivery-api/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/14/umbraco-cms/reference/content-delivery-api/README.md b/14/umbraco-cms/reference/content-delivery-api/README.md index 0dbb86c32a5..ce4654be69e 100644 --- a/14/umbraco-cms/reference/content-delivery-api/README.md +++ b/14/umbraco-cms/reference/content-delivery-api/README.md @@ -14,13 +14,13 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ### Enable the Content Delivery API -You can enable the Delivery API when creating you project initially by using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. +When creating your project, you can enable the Delivery API using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. ```bash dotnet new umbraco -n MyProject -da ``` -Yuo can also enable it after the fact with the following steps: +You can also enable the Delivery API at a later point by following these steps: 1. Open your project's `appsettings.json`. 2. Insert the `DeliveryApi` configuration section under `Umbraco:CMS`. diff --git a/15/umbraco-cms/reference/content-delivery-api/README.md b/15/umbraco-cms/reference/content-delivery-api/README.md index 0dbb86c32a5..ce4654be69e 100644 --- a/15/umbraco-cms/reference/content-delivery-api/README.md +++ b/15/umbraco-cms/reference/content-delivery-api/README.md @@ -14,13 +14,13 @@ The Delivery API is an opt-in feature in Umbraco. It must be explicitly enabled ### Enable the Content Delivery API -You can enable the Delivery API when creating you project initially by using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. +When creating your project, you can enable the Delivery API using the `--use-delivery-api` or `-da` flag. This will automatically add the necessary configuration to your project. ```bash dotnet new umbraco -n MyProject -da ``` -Yuo can also enable it after the fact with the following steps: +You can also enable the Delivery API at a later point by following these steps: 1. Open your project's `appsettings.json`. 2. Insert the `DeliveryApi` configuration section under `Umbraco:CMS`.