Skip to content

Commit e172fe6

Browse files
docs: add overdrive docs
1 parent 5c68370 commit e172fe6

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.github/workflows/generate-docs.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ jobs:
2121
run: python -m pip install -U md2html-phuker
2222

2323
- name: Generate HTML documentation
24-
run: md2html DOCS.md
24+
run: |
25+
md2html docs/s4-api-docs.md
26+
md2html docs/s4-api-docs-od.md
2527
2628
- name: Upload artifact
2729
uses: actions/upload-artifact@v4
2830
with:
2931
name: docs
30-
path: DOCS.html
32+
path: docs

docs/s4-api-docs-od.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# \[OVERDRIVE\] Session 4 API Documentation
2+
3+
This is the API documentation for the AEC 2024 Skill 08 Session 4 API.
4+
5+
## Events
6+
7+
The API provides an endpoint to subscribe to the actions of an event and sending an answer to a voting poll.
8+
9+
### Subscribe to an Event
10+
11+
This endpoint uses HTTP Long Polling, meaning the connection will remain open until an action is available. Clients should make a request to this endpoint and wait for a response. Once a response is received, the client should immediately make another request to continue receiving actions.
12+
13+
For the initial request, it is possible to pass the query parameter `wait=false` to get the current action immediately.
14+
15+
```
16+
GET /events/:id/subscribe
17+
```
18+
19+
Example Response
20+
21+
```json
22+
{
23+
"action": {
24+
"type": "vote",
25+
"question": "Which protocol is used to transfer web pages over the internet?",
26+
"answerA": "HTTP",
27+
"answerB": "FTP"
28+
}
29+
}
30+
```
31+
32+
### Answer a Poll
33+
34+
This endpoint allows clients to answer a poll. The client should make a POST request to this endpoint with the answer in the request body.
35+
36+
```
37+
POST /events/:id/vote
38+
```
39+
40+
Request Body
41+
42+
```
43+
{
44+
answer: "a" | "b"
45+
}
46+
```

DOCS.md docs/s4-api-docs.md

File renamed without changes.

0 commit comments

Comments
 (0)