diff --git a/14/umbraco-cms/reference/content-delivery-api/README.md b/14/umbraco-cms/reference/content-delivery-api/README.md index 99665809572..ce4654be69e 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 +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 +``` + +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`. 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..ce4654be69e 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 +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 +``` + +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`. 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.