-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
43 lines (34 loc) · 873 Bytes
/
test.js
File metadata and controls
43 lines (34 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env node
/**
* SimpleCron Test Script
*
* Test the cron service with a simple endpoint
*/
import axios from 'axios'
import dotenv from 'dotenv'
dotenv.config()
const testEndpoint = async () => {
const url = process.env.ENDPOINT_1_URL
const headers = JSON.parse(process.env.ENDPOINT_1_HEADERS || '{}')
if (!url) {
console.log('❌ No test endpoint configured')
return
}
console.log(`🧪 Testing endpoint: ${url}`)
try {
const response = await axios({
method: 'POST',
url,
headers,
timeout: 30000
})
console.log(`✅ Test successful: ${response.status}`)
console.log(`📄 Response:`, response.data)
} catch (error) {
console.log(`❌ Test failed:`, error.message)
if (error.response) {
console.log(`📄 Response:`, error.response.data)
}
}
}
testEndpoint()