diff --git a/src/content/docs/en/recipes/call-endpoints.mdx b/src/content/docs/en/recipes/call-endpoints.mdx index cbd498869139a..d7d689b04cc96 100644 --- a/src/content/docs/en/recipes/call-endpoints.mdx +++ b/src/content/docs/en/recipes/call-endpoints.mdx @@ -4,6 +4,7 @@ description: Learn how to call endpoints from the server in Astro. i18nReady: true type: recipe --- +import { Steps } from '@astrojs/starlight/components'; Endpoints can be used to serve many kinds of data. This recipe calls a server endpoint from a page's component script to display a greeting, without requiring an additional fetch request. @@ -13,6 +14,7 @@ Endpoints can be used to serve many kinds of data. This recipe calls a server en ## Recipe + 1. Create an endpoint in a new file `src/pages/api/hello.ts` that returns some data: ```ts title="src/pages/api/hello.ts" @@ -39,3 +41,4 @@ Endpoints can be used to serve many kinds of data. This recipe calls a server en

{data.greeting} world!

``` +