Skip to content

Commit 045a3d4

Browse files
committed
Improved docs on endpoints
1 parent 1556cd1 commit 045a3d4

File tree

4 files changed

+37
-429
lines changed

4 files changed

+37
-429
lines changed

.vitepress/config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export default defineConfig({
133133
{ text: "pi-part", link: "/api/components/pi-part" },
134134
],
135135
},
136+
{
137+
text: "Service Endpoints",
138+
items: [{ text: "Fragment", link: "/api/endpoints/fragment" }],
139+
},
136140
{
137141
text: "Configuration",
138142
items: [

api/endpoints/fragment.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Fragment Endpoint
2+
3+
The fragment endpoint can be passed in to SSR variants such as `picard-js/node` via the `fragmentUrl` option.
4+
5+
The given fragment endpoint has to accept `GET` requests using the following specification.
6+
7+
## Request Parameters
8+
9+
The following request path parameters are send:
10+
11+
| Name | Type | Description | Example |
12+
| ---- | -------- | ---------------------------------------- | ---------- |
13+
| id | `string` | The base 64 encoded name of the fragment | `dGVzdA==` |
14+
15+
The URL is thought as `/<your-url>/{id}`, e.g., if you specified `/api/v1/fragment` as your `fragmentUrl` then `/api/v1/fragment/dGVzdA==` would be called to retrieve the fragment of `test`.
16+
17+
The following request query parameters are send:
18+
19+
| Name | Type | Description | Example |
20+
| ---- | -------- | --------------------------------------------- | ---------------------- |
21+
| data | `string` | The base 64 encoded JSON string with the data | `eyJmb28iOiJiYXIifQ==` |
22+
23+
The `data` is always presented as an object that is stringified by a JSON serialization with the base 64 encoding being performed to be URL safe.
24+
25+
## Response
26+
27+
The response must be send as an HTML fragment usign the `text/html` value set in the `Content-Type` header.

api/endpoints/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Endpoints Overview
2+
3+
The following sections on the required endpoint for SSR fragments exists:
4+
5+
- [Fragment endpoint](./fragment.md)

0 commit comments

Comments
 (0)