Skip to content

Commit

Permalink
Merge pull request #5952 from marcemarc/patch-7
Browse files Browse the repository at this point in the history
In v13 there is no startup.cs file
  • Loading branch information
alina-tincas authored Mar 21, 2024
2 parents 2ee76fd + 10edac5 commit ea75b1c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions 13/umbraco-cms/reference/content-delivery-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ The Content Delivery API delivers headless capabilities built directly into Umbr

The Delivery API is an opt-in feature of Umbraco. It must be explicitly enabled through configuration before it can be utilized.

Umbraco projects started on version 11 or below also need to opt-in through code by [registering the delivery API dependencies](./#register-the-content-delivery-api-dependencies). Below you will find a description of how to do this.

For a fresh Umbraco installation you can proceed directly to the [Enable the Content Delivery API](./#enable-the-content-delivery-api) section.

{% embed url="https://www.youtube.com/watch?v=sh_AF-ZKJ28" %}
Video tutorial
{% endembed %}

### Register the Content Delivery API dependencies
<details>
<summary>Register the Content Delivery API dependencies - **Only for Version 12 or below** </summary>

{% hint style="info" %}
This step is only applicable for Umbraco projects started on version 11 or below.
{% endhint %}
Umbraco projects started on version 11 or below also need to opt-in through code to use the Content Delivery API. Follow the steps below to see how to opt-in through code:

1. Open your project's `Startup.cs` file and locate the `ConfigureServices` method.
2. Register the API dependencies by adding `.AddDeliveryApi()`:
Expand All @@ -40,6 +35,12 @@ public void ConfigureServices(IServiceCollection services)
}
```

From version 13 and above, the Content Delivery API is added by default in `program.cs`.

The next step is to enable the Content Delivery API in `appsettings.json`. Follow the next section [Enable the Content Delivery API](./#enable-the-content-delivery-api) for this.

</details>

### Enable the Content Delivery API

1. Open your project's `appsettings.json`.
Expand Down

0 comments on commit ea75b1c

Please sign in to comment.