You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,11 +22,11 @@ There are three key parts that make up this system.
22
22
23
23
### Pages
24
24
#### Specifying a file in the meta
25
-
You can define files in a resource that will be accessible via the web server. To do this, you need to add them to [meta.xml](/reference/Meta.xml) using the [html tag](/reference/Meta.xml#tags).
25
+
You can define files in a resource that will be accessible via the web server. To do this, you need to add them to [meta.xml](/reference/Meta.xml) using the [html tag](/reference/Meta.xml#html).
26
26
```xml
27
27
<htmlsrc="index.html" />
28
28
```
29
-
The [html tag](/reference/Meta.xml#tags) in addition to **src** has two more attributes:
29
+
The [html tag](/reference/Meta.xml#html) in addition to **src** has two more attributes:
30
30
-**default** - Specifies the file that will be the main page of the resource.
31
31
-**raw** - Indicates that the file will not be parsed by the Lua interpreter and is treated as a binary file (used, for example, for images).
32
32
@@ -192,83 +192,19 @@ end
192
192
This section describes all the fields, that can be found in the request table passed to the router function for every call.
193
193
The descriptions below use the following example URL: http://127.0.0.1:22005/api/vehicles/123?meow=true (**api** is the resource name).
194
194
195
-
<table>
196
-
<thead>
197
-
<tr>
198
-
<th>Field</th>
199
-
<th>Type</th>
200
-
<th>Description</th>
201
-
</tr>
202
-
</thead>
203
-
204
-
<tbody>
205
-
<tr>
206
-
<td>account</td>
207
-
<td>[account](/reference/account)</td>
208
-
<td>An account that was used for this request (can be a [guest account](/reference/isGuestAccount)).</td>
209
-
</tr>
210
-
211
-
<tr>
212
-
<td>method</td>
213
-
<td>[string](/reference/string)</td>
214
-
<td>One of the following: `OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PATCH`.</td>
215
-
</tr>
216
-
217
-
<tr>
218
-
<td>path</td>
219
-
<td>[string](/reference/string)</td>
220
-
<td>The requested path within your resource: `/vehicles/123`.</td>
221
-
</tr>
222
-
223
-
<tr>
224
-
<td>absolute_path</td>
225
-
<td>[string](/reference/string)</td>
226
-
<td>The absolute path from the URL: `/api/vehicles/123?meow=true"`.</td>
227
-
</tr>
228
-
229
-
<tr>
230
-
<td>hostname</td>
231
-
<td>[string](/reference/string)</td>
232
-
<td>The hostname of the web server: `127.0.0.1`.</td>
233
-
</tr>
234
-
235
-
<tr>
236
-
<td>port</td>
237
-
<td>[integer](/reference/int)</td>
238
-
<td>The client port used by the web server: `56758` (can be anything, but **never** 22005).</td>
239
-
</tr>
240
-
241
-
<tr>
242
-
<td>body</td>
243
-
<td>[string](/reference/string)</td>
244
-
<td> The body portion of the request sent by the client.</td>
245
-
</tr>
246
-
247
-
<tr>
248
-
<td>query</td>
249
-
<td>[table](/reference/table)</td>
250
-
<td>A key-value table (with [string](/reference/string) keys and values) with the path's query fields (only query).</td>
251
-
</tr>
252
-
253
-
<tr>
254
-
<td>formData</td>
255
-
<td>[table](/reference/table)</td>
256
-
<td>A key-value table (with [string](/reference/string) keys and values) with the request form data (both query and body fields).</td>
257
-
</tr>
258
-
259
-
<tr>
260
-
<td>cookies</td>
261
-
<td>[table](/reference/table)</td>
262
-
<td>A key-value table (with [string](/reference/string) keys and values) with the request cookies.</td>
263
-
</tr>
264
-
265
-
<tr>
266
-
<td>headers</td>
267
-
<td>[table](/reference/table)</td>
268
-
<td>A key-value table (with [string](/reference/string) keys and values) with the request headers (like User-Agent).</td>
269
-
</tr>
270
-
</tbody>
271
-
</table>
195
+
| Field | Type | Description |
196
+
| :--- | :--- | :--- |
197
+
|`account`|[account](/reference/account)| An account that was used for this request (can be a [guest account](/reference/isGuestAccount)). |
198
+
|`method`|[string](/reference/string)| One of the following: `OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PATCH`. |
199
+
|`path`|[string](/reference/string)| The requested path within your resource: `/vehicles/123`. |
200
+
|`absolute_path`|[string](/reference/string)| The absolute path from the URL: `/api/vehicles/123?meow=true`. |
201
+
|`hostname`|[string](/reference/string)| The hostname of the web server: `127.0.0.1`. |
202
+
|`port`|[integer](/reference/int)| The client port used by the web server: `56758` (can be anything, but **never** 22005). |
203
+
|`body`|[string](/reference/string)| The body portion of the request sent by the client. |
204
+
|`query`|[table](/reference/table)| A key-value table (mit [string](/reference/string) keys and values) with the path's query fields (only query). |
205
+
|`formData`|[table](/reference/table)| A key-value table (with [string](/reference/string) keys and values) with the request form data (both query and body fields). |
206
+
|`cookies`|[table](/reference/table)| A key-value table (with [string](/reference/string) keys and values) with the request cookies. |
207
+
|`headers`|[table](/reference/table)| A key-value table (with [string](/reference/string) keys and values) with the request headers (like User-Agent). |
272
208
273
209
### Response
274
210
This section describes all the possible variants, that can be returned by the router function. There are three variants in total:
@@ -278,41 +214,12 @@ This section describes all the possible variants, that can be returned by the ro
278
214
- Return a [table](/reference/table): response will be filled with the fields from the table (defaults to http status code 200 and empty body, if not overriden by a table field).
279
215
280
216
#### Response table fields
281
-
<table>
282
-
<thead>
283
-
<tr>
284
-
<th>Field</th>
285
-
<th>Type</th>
286
-
<th>Description</th>
287
-
</tr>
288
-
</thead>
289
-
290
-
<tbody>
291
-
<tr>
292
-
<td>status</td>
293
-
<td>[integer](/reference/int)</td>
294
-
<td>A number that will be converted to an http status code.</td>
295
-
</tr>
296
-
297
-
<tr>
298
-
<td>body</td>
299
-
<td>[string](/reference/string)</td>
300
-
<td>A string that will be used for the response body.</td>
301
-
</tr>
302
-
303
-
<tr>
304
-
<td>headers</td>
305
-
<td>[table](/reference/table)</td>
306
-
<td>A key-value table (with [string](/reference/string) keys and values) that will be written to the header section of the response.</td>
307
-
</tr>
308
-
309
-
<tr>
310
-
<td>cookies</td>
311
-
<td>[table](/reference/table)</td>
312
-
<td>A table with simple [string](/reference/string) key and value entries, or any-type key with [table](/reference/table) values (key is not used), entries. Check the examples below, if it's unclear.</td>
313
-
</tr>
314
-
</tbody>
315
-
</table>
217
+
| Field | Type | Description |
218
+
| :--- | :--- | :--- |
219
+
|`status`|[integer](/reference/int)| A number that will be converted to an http status code. |
220
+
|`body`|[string](/reference/string)| A string that will be used for the response body. |
221
+
|`headers`|[table](/reference/table)| A key-value table (with [string](/reference/string) keys and values) that will be written to the header section of the response. |
222
+
|`cookies`|[table](/reference/table)| A table with simple [string](/reference/string) key and value entries, or any-type key with [table](/reference/table) values (key is not used), entries. Check the examples below, if it's unclear. |
0 commit comments