Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit b3145c5

Browse files
committed
feat: Add selfhosting guide to sidebar
1 parent 364c13f commit b3145c5

2 files changed

Lines changed: 47 additions & 4 deletions

File tree

doc/.vitepress/config.mts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@ export default defineConfig({
1717
{
1818
text: 'API',
1919
collapsed: true,
20+
link: '/api/starting',
2021
items: [
2122
{ text: 'Full reference', link: '/api/ref' },
2223
{ text: 'Usage examples', link: '/api/examples' }
2324
]
25+
},
26+
{
27+
text: 'Self Hosting',
28+
collapsed: true,
29+
link: '/selfhost/starting',
30+
items: [
31+
{ text: 'Configuration', link: '/selfhost/config' }
32+
]
2433
}
2534
],
2635

doc/api/ref.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ The server may respond with...
6868

6969
Create a new user.
7070

71+
Before `POST`ing to `/u`, get the data from `/init`. See Authorization section
72+
for information.
73+
7174
#### Payload
7275

7376
* `username`: The display name of the user
7477
* `password`: The password for the new user (will be hashed before storing)
78+
* `sid`: The session ID you got from `/init`
79+
* `captcha`: The solution to the captcha you got from `/init`
7580

7681
#### Response
7782

@@ -91,16 +96,13 @@ The server may respond with...
9196

9297
Get a user by their ID.
9398

94-
#### Payload
95-
96-
None.
97-
9899
#### Response
99100

100101
* `username`: The display name of the user
101102
* `id`: The user's ID
102103
* `created`: The time the user registered
103104
* `about`: The user's biography
105+
* `items`: A list of the IDs of the items the user has created
104106

105107
### GET `/u`
106108

@@ -135,10 +137,34 @@ the item they were replying to.
135137

136138
Create a new item.
137139

140+
#### Payload
141+
142+
* `title`: The title of the item (only applicable for posts)
143+
* `content`: The content of the item
144+
* `parent`: The ID of the parent item (only applicable for comments)
145+
146+
#### Response
147+
148+
The server may respond with...
149+
150+
* `201 Created` if the item was successfully made
151+
* `400 Bad Request` if the `content` field is missing, or the `parent` **and**
152+
`title` fields are missing.
153+
* `404 Not Found` if the parent ID is invalid (empty is not invalid)
154+
* `500 Internal Server Error` if the server encountered an error.
155+
138156
### GET `/i/{id}`
139157

140158
Get an item by ID.
141159

160+
#### Response
161+
162+
* `creator`: The ID of the user who made the item
163+
* `id`: The ID of the item
164+
* `parent`: The ID of the parent of the item (only applicable for comments)
165+
* `title`: The title of the item (only applicable for posts)
166+
* `children`: A list of IDs of comments replying to the item.
167+
142168
### PATCH `/i/{id}`
143169

144170
Update an item by ID. This can only be done by its creator.
@@ -148,6 +174,14 @@ Update an item by ID. This can only be done by its creator.
148174
Delete an item by ID. This can only be done by its creator or an instance
149175
administrator.
150176

177+
#### Response
178+
179+
The server may respond with...
180+
181+
* `204 No Content` if deletion was successful
182+
* `404 Not Found` if the item is not found
183+
* `500 Internal Server Error` if the server had an error.
184+
151185
### GET `/i?limit={limit}&offset={offset}&sort={sort}`
152186

153187
The `sort` parameter should be one of:

0 commit comments

Comments
 (0)