Skip to content

Commit 23c4df2

Browse files
committed
test: setting the cron from the dashboard
1 parent 8c33c2a commit 23c4df2

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ addEventListener('scheduled', event => {
88
})
99

1010
async function handleRequest(request) {
11-
// await triggerExport()
11+
const { pathname } = new URL(request.url)
12+
if (pathname === '/test') await triggerExport()
1213
return new Response('OK', { status: 200 })
1314
}

src/lib/notion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const _BASEURL = 'https://www.notion.so/api/v3'
22
const _HEADERS = {
3-
Cookie: `token_v2=${TOKEN_V2};`,
3+
Cookie: `token_v2=${typeof TOKEN_V2 !== undefined ? TOKEN_V2 : ''};`,
44
'Content-Type': 'application/json',
55
}
66

wrangler.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ workers_dev = true
66
route = ""
77
zone_id = ""
88
compatibility_date = "2022-04-29"
9-
[triggers]
10-
crons = ["* * * * *"]
11-
#[secrets]
12-
#TOKEN_V2
13-
#SLACK_WEBHOOK
14-
#DISCORD_WEBHOOK
15-
#EXPORT_TYPE
16-
#LOCALE
17-
#TIMEZONE
9+
# [secrets]
10+
# TOKEN_V2
11+
# SLACK_WEBHOOK
12+
# DISCORD_WEBHOOK
13+
# EXPORT_TYPE
14+
# LOCALE
15+
# TIMEZONE

0 commit comments

Comments
 (0)