diff --git a/public/index.html b/public/index.html index 1bd6026..e768b22 100644 --- a/public/index.html +++ b/public/index.html @@ -1,26 +1,68 @@ -
{"sub":"jon@example.com"}
+ # Ask for an auth code (swap sub)
+
curl -X POST http://localhost:4080/api/sessions \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"sub":"jon@example.com"}'
+
+ {"otp":"auth-code"}
+ # Validate auth code (swap session id, sub, and otp)
-# Validate auth code (swap session id, sub, and otp)
curl -X POST http://localhost:4080/api/sessions/xyz \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"otp":"secret123"}'
+
+ Authorization: Bearer api-token
+
{"message":"Hello, World!"}
+ # Post a message (swap api-token)
-# Post a message (swap api-token)
curl -X POST http://localhost:4080/api/rooms/general \
-H 'Authorization: Bearer api-token' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"message":"Hello, World!"}'
+
+ Authorization: Bearer api-token
+
{"message":"Hello, World!"}
+ # Get a room's messages (swap api-token, since unix-epoch)
+
+curl http://localhost:4080/api/rooms/general \
-H 'Authorization: Bearer api-token'
+