Skip to content

Commit

Permalink
docs: enhanced endpoint docs (QwikDev#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanettin authored Nov 2, 2022
1 parent a0726ec commit 6c68c5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/docs/src/routes/qwikcity/data/endpoints/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Qwik City is able to create a RESTful API for your application using Endpoints.

Both "page" and "endpoints" are the same except for one difference: a page exports a `default component$()` to render HTML, whereas an endpoint exports only HTTP request and response handlers. To learn about defining a page component, you can [read more here](../../content/component/index.mdx). An endpoint route however, is used only for the purpose of responding with data.

To consume the data fetched on an endpoint you can use the provided `useResource$` hook or the `<Resource />` component as described [here](../../../../routes/docs/components/resource/index.mdx).

## Example API endpoint route

```ts
Expand Down

0 comments on commit 6c68c5b

Please sign in to comment.