X-Git-Url: https://git.cworth.org/git?p=lmno-api;a=blobdiff_plain;f=tictactoe.txt;fp=tictactoe.txt;h=62046a6e23822d5d72f907c95adfb9f2c6c39826;hp=0000000000000000000000000000000000000000;hb=16c1fd9d8043ba1970080bfd19929d304b522eec;hpb=366bac0a9b0f26218d5d78b7ba547717fb07a987 diff --git a/tictactoe.txt b/tictactoe.txt new file mode 100644 index 0000000..62046a6 --- /dev/null +++ b/tictactoe.txt @@ -0,0 +1,44 @@ +Tic Tac Toe Game Protocol +========================= +Note: All square numbers in the protol below are as follows: + + 0|1|2 + -+-+- + 3|4|5 + -+-+- + 6|7|8 + +For a specific game the following API endpoints are defined. +(Note: Only the trailing portion of the API URI is provided here. + The preceding portions of the path must be determined externally.) + +/events + + This is a server-sent events stream that allows the server to push + game-related events to clients. When a client connects to this API + endpoint the server will return a header that includes: + + Content-type: text/event-stream + Connection: keep-alive + Cache-Control: no-cache + + and will keep the connection open to return events. + + The following event types will be returned by the server: + + TYPE: move + + WHEN: When a client (maybe yourself) issues a legal move + + EXAMPLE: + + event: move + data: 4 + +/move + + Method: POST + + Behavior: Adds a new move to the game + + Example data: { "square": 4 }