fix: typo in config example

pull/5/head
lyc8503 2023-11-19 15:08:52 +08:00
parent ccbb48b040
commit 504197a94a
1 changed files with 9 additions and 10 deletions

View File

@ -15,10 +15,9 @@ const config = {
}, },
callback: async (statusChangeMsg: string) => { callback: async (statusChangeMsg: string) => {
// Write any typescript here // Write any typescript here
// Example `statusChangeMsg` string: // Example `statusChangeMsg` string:
// "❌My Blog went down at 2023/11/18 14:08:59 with error Timeout after 10000ms" // "❌My Blog went down at 2023/11/18 14:08:59 with error Timeout after 10000ms"
// "✔My Blog came back up at 2023/11/18 14:10:48 after 2 minutes of downtime" // "✔My Blog came back up at 2023/11/18 14:10:48 after 2 minutes of downtime"
// Example: // Example:
// await fetch('https://api.example.com/callback?msg=' + statusChangeMsg) // await fetch('https://api.example.com/callback?msg=' + statusChangeMsg)
}, },
@ -34,19 +33,19 @@ const config = {
method: 'POST', method: 'POST',
// `target` is a valid URL // `target` is a valid URL
target: 'https://example.com', target: 'https://example.com',
// [OPTIONAL] `expectedCode` is an array of acceptable HTTP response codes, if not specified, default to 2xx // [OPTIONAL] `expectedCodes` is an array of acceptable HTTP response codes, if not specified, default to 2xx
expectedCode: [200], expectedCodes: [200],
// [OPTIONAL] `timeout` in millisecond, if not specified, default to 10000 // [OPTIONAL] `timeout` in millisecond, if not specified, default to 10000
timeout: 10000, timeout: 10000,
// [OPTIONAL] headers to be sent // [OPTIONAL] headers to be sent
headers: { headers: {
'User-Agent': 'Uptimeflare', 'User-Agent': 'Uptimeflare',
'Authorization': 'Bearer YOUR_TOKEN_HERE' Authorization: 'Bearer YOUR_TOKEN_HERE',
}, },
// [OPTIONAL] body to be sent // [OPTIONAL] body to be sent
body: "Hello, world!", body: 'Hello, world!',
// [OPTIONAL] if specified, the response must contains the keyword to be considered as operational. // [OPTIONAL] if specified, the response must contains the keyword to be considered as operational.
responseKeyword: "success" responseKeyword: 'success',
}, },
// Example TCP Monitor // Example TCP Monitor
{ {
@ -56,9 +55,9 @@ const config = {
method: 'TCP_PING', method: 'TCP_PING',
// `target` should be `host:port` for tcp monitors // `target` should be `host:port` for tcp monitors
target: '1.2.3.4:22', target: '1.2.3.4:22',
timeout: 5000 timeout: 5000,
} },
] ],
} }
// Don't forget this, otherwise compilation fails. // Don't forget this, otherwise compilation fails.