Skip to content

Commit 8266596

Browse files
fix schema
1 parent bdf6444 commit 8266596

File tree

1 file changed

+50
-18
lines changed

1 file changed

+50
-18
lines changed

website/static/schema.json

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,54 @@
2929
"type": "object",
3030
"properties": {
3131
"preload": {
32-
"description": "List of component dependencies to preload. Preloading components can improve performance by fetching dependencies before they are needed.",
32+
"description": "Path to a JavaScript file to preload on the HTML server when running oc dev. This file will be executed to set up any necessary initialization code.",
33+
"type": "string",
34+
"example": "./preload.js"
35+
},
36+
"routes": {
37+
"description": "Custom routing configuration for the development server. Allows defining custom routes with HTTP methods and handlers.",
3338
"type": "array",
3439
"items": {
35-
"type": "string",
36-
"description": "Component name or path to preload"
40+
"type": "object",
41+
"properties": {
42+
"route": {
43+
"type": "string",
44+
"description": "The URL route pattern (e.g., '/', '/api/users')"
45+
},
46+
"method": {
47+
"type": "string",
48+
"description": "HTTP method for the route",
49+
"enum": [
50+
"GET",
51+
"POST",
52+
"PUT",
53+
"DELETE",
54+
"PATCH",
55+
"HEAD",
56+
"OPTIONS"
57+
],
58+
"example": "GET"
59+
},
60+
"handler": {
61+
"type": "string",
62+
"description": "Path to the JavaScript file that handles this route"
63+
}
64+
},
65+
"required": [
66+
"route",
67+
"method",
68+
"handler"
69+
],
70+
"additionalProperties": false
3771
},
3872
"example": [
39-
"header",
40-
"footer",
41-
"common-ui"
73+
{
74+
"route": "/",
75+
"method": "GET",
76+
"handler": "./authRoute.js"
77+
}
4278
]
4379
},
44-
"routes": {
45-
"description": "Custom routing configuration for components. Allows defining custom URL patterns and mappings for component rendering.",
46-
"type": "object",
47-
"additionalProperties": {
48-
"type": "string",
49-
"description": "Route pattern mapped to component name or path"
50-
},
51-
"example": {
52-
"/custom-header": "header-component",
53-
"/api/*": "api-wrapper"
54-
}
55-
},
5680
"fallback": {
5781
"description": "Fallback configuration for when components cannot be found in the local registry. Allows specifying a fallback registry URL and optionally using its client library.",
5882
"type": "object",
@@ -162,6 +186,14 @@
162186
"https://my-registry.com"
163187
],
164188
"development": {
189+
"preload": "./preload.js",
190+
"routes": [
191+
{
192+
"route": "/",
193+
"method": "GET",
194+
"handler": "./authRoute.js"
195+
}
196+
],
165197
"fallback": {
166198
"url": "https://fallback-registry.com",
167199
"client": true

0 commit comments

Comments
 (0)