Skip to content

Commit

Permalink
fix: web worker handler should be generic to support both client types
Browse files Browse the repository at this point in the history
BREAKING CHANGE: rename `createCloudflareWorker` to `createWebWorkerHandler`
  • Loading branch information
baoshan committed Jun 22, 2022
1 parent 1c04f9b commit 7f7a9ab
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 54 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,20 +964,20 @@ function onUnhandledRequest(request, response) {
</tbody>
</table>

### `createCloudflareHandler(app, options)`
### `createWebWorkerHandler(app, options)`

Event handler for Cloudflare workers.
Event handler for web worker environments (Cloudflare workers or Deno).

```js
// worker.js
import { OAuthApp, createCloudflareHandler } from "@octokit/oauth-app";
import { OAuthApp, createWebWorkerHandler } from "@octokit/oauth-app";
const app = new OAuthApp({
clientType: "oauth-app",
clientId: "1234567890abcdef1234",
clientSecret: "1234567890abcdef1234567890abcdef12345678",
});

const handleRequest = createCloudflareHandler(app, {
const handleRequest = createWebWorkerHandler(app, {
pathPrefix: "/api/github/oauth",
});

Expand Down

0 comments on commit 7f7a9ab

Please sign in to comment.