forked from zotero/zotero
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new init(options) signature for server endpoints
An endpoint can now take a single object containing 'method', 'pathname', 'query', 'headers', and 'data' and return an integer, an array containing [statusCode, contentType, body], or a promise for either. This allows the handlers to use the HTTP method and headers and removes the need for callbacks when some handlers already use coroutine(). If init() returns a promise, it now has to use the new single-parameter signature (because the check is done with Function.length, and combining promises and callbacks doesn't make sense anyway).
- Loading branch information
Showing
3 changed files
with
229 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.