Skip to content

Commit

Permalink
docs: add overdrive docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Frost committed May 19, 2024
1 parent 5c68370 commit e172fe6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/generate-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ jobs:
run: python -m pip install -U md2html-phuker

- name: Generate HTML documentation
run: md2html DOCS.md
run: |
md2html docs/s4-api-docs.md
md2html docs/s4-api-docs-od.md
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: DOCS.html
path: docs
46 changes: 46 additions & 0 deletions docs/s4-api-docs-od.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# \[OVERDRIVE\] Session 4 API Documentation

This is the API documentation for the AEC 2024 Skill 08 Session 4 API.

## Events

The API provides an endpoint to subscribe to the actions of an event and sending an answer to a voting poll.

### Subscribe to an Event

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.

For the initial request, it is possible to pass the query parameter `wait=false` to get the current action immediately.

```
GET /events/:id/subscribe
```

Example Response

```json
{
"action": {
"type": "vote",
"question": "Which protocol is used to transfer web pages over the internet?",
"answerA": "HTTP",
"answerB": "FTP"
}
}
```

### Answer a Poll

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.

```
POST /events/:id/vote
```

Request Body

```
{
answer: "a" | "b"
}
```
File renamed without changes.

0 comments on commit e172fe6

Please sign in to comment.