31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
const axios = require('axios');
|
|
|
|
async function testCloudFunctions() {
|
|
console.log('🧪 Testing cloud functions...');
|
|
|
|
const baseURL = 'http://localhost:1337/parse';
|
|
const headers = {
|
|
'X-Parse-Application-Id': process.env.appID || 'your-app-id',
|
|
'Content-Type': 'application/json'
|
|
};
|
|
|
|
try {
|
|
// Test simple cloud function
|
|
console.log('📞 Calling testCloudFunction...');
|
|
const response = await axios.post(`${baseURL}/functions/testCloudFunction`, {}, { headers });
|
|
console.log('✅ Cloud function response:', response.data);
|
|
|
|
// Test templates function
|
|
console.log('📞 Calling getCharacterTemplates...');
|
|
const templatesResponse = await axios.post(`${baseURL}/functions/getCharacterTemplates`, {}, { headers });
|
|
console.log('✅ Templates response:', templatesResponse.data);
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error testing cloud functions:', error.message);
|
|
if (error.response) {
|
|
console.error('Response data:', error.response.data);
|
|
}
|
|
}
|
|
}
|
|
|
|
testCloudFunctions();
|