Skip to content

Commit 4030a37

Browse files
committed
📝 Update README.
1 parent 3a14172 commit 4030a37

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,29 @@ addEventListener('fetch', (event) => {
1919
> ```toml
2020
> type = "webpack"
2121
> ```
22+
23+
## Options
24+
- `cacheName`: string = undefined
25+
> If it is `undefined`, no caches will be used. If it's `"default"`, the default cache will be used; otherwise a new cache is opened using the provided name. See [`await caches.open(name)`](https://developers.cloudflare.com/workers/runtime-apis/cache#accessing-cache).
26+
- `cacheTTL`: number = 300000 (in ms)
27+
> The value is used to generate the max age of `Cache-Control` and compute the `Expires` time.
28+
- `cors`: boolean = false
29+
> Allow CORS or not. If set, CORS headers will be generated and OPTIONS method will be handled.
30+
- `hashAlgorithm`: "sha1" | "sha256" | "sha384" | "sha512" = "sha1"
31+
> Hash algorithm to use to generate ETag.
32+
- `leetcodeGraphqlUrl`: string = "https://leetcode.com/graphql"
33+
> LeetCode GraphQL endpoint.
34+
- `progressType`: "global" | "session" = "global"
35+
> Type of LeetCode progress to display. If it's "session", the statistics of the current active session is fetched.
36+
>
37+
> This option is set for the default progress type; however, at each request, ones can provided `progress-type` parameter in the query string to change the value.
38+
- `userlist`: Set<string> = undefined
39+
> Access control for your Worker. If provided, only usernames appear in the set is allowed to generate the progress; otherwise, 403 forbidden is responsed.
40+
>
41+
> Note that leave it undefined means access control disabled, every is allowed to access the Worker.
42+
- `fetch`: typeof [fetch](https://developers.cloudflare.com/workers/runtime-apis/fetch) = fetch
43+
> This option is passed to `graphql-request` to avoid using XMLHttpRequest (No such API in Worker Runtime).
44+
45+
## Query String Parameters
46+
- `username`: string
47+
- `progress-type`: "global" | "session"

0 commit comments

Comments
 (0)