From 458a4e4068dd58c6bec1449738ae8e1edb07af41 Mon Sep 17 00:00:00 2001 From: Ben Ellis Date: Fri, 4 Nov 2016 10:28:11 -0400 Subject: [PATCH] Add refs to Fetch, WebSocket, and Promise specs --- README.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1f0b5a9..67558bb 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,13 @@ TODO # Dependencies -TODO +FlyWeb uses [`Promise`][Promise reference] objects as defined in the [ES6 +specification][Promise specification]. + +FlyWeb's API for hosting a server endpoint from a webpage uses the classes +defined in the [Fetch Standard] and the [WebSocket specification] to represent +both typical HTTP traffic [to][Fetch API request] and [from][Fetch API response] +the page-hosted server as well as [bidirectional, persistent connections][WebSocket interface]. # Terminology @@ -170,11 +176,11 @@ interface FlyWebFetchEvent : Event { }; ``` -The `request` attribute holds a DOM `Request` object describing the -details of the HTTP request. +The `request` attribute holds a DOM [`Request`][Fetch API request] object +describing the details of the HTTP request. The `respondWith` method on the event can accept a `Promise` for -resolving a `Response` object to service the HTTP request. +resolving a [`Response`][Fetch API response] object to service the HTTP request. ### onwebsocket @@ -193,12 +199,21 @@ interface FlyWebWebSocketEvent : Event { }; ``` -The `request` attribute holds a DOM `Request` object describing the +The `request` attribute holds a DOM [`Request`][Fetch API Request] object describing the details of the WebSocket request. The `accept` method on the event can be used to accept the WebSocket -request. It immediately returns a WebSocket instance which can be used +request. It immediately returns a [`WebSocket`][WebSocket interface] instance which can be used to communicate with the client. The `respondWith` method on the event can accept a `Promise` for -resolving a `Response` object to service the WebSocket request. +resolving a [`Response`][Fetch API Response] object to service the WebSocket request. + + +[Fetch Standard]: https://fetch.spec.whatwg.org/ +[Fetch API request]: https://fetch.spec.whatwg.org/#request-class +[Fetch API response]: https://fetch.spec.whatwg.org/#response-class +[WebSocket specification]: https://html.spec.whatwg.org/multipage/comms.html#network +[WebSocket interface]: https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface +[Promise specification]: http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects +[Promise reference]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise