Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
628 B
0
Indexable
Never
const axios = require('axios');

// Replace these values with your cPanel and website details
const cPanelUsername = 'your_cpanel_username';
const cPanelPassword = 'your_cpanel_password';
const websiteUrl = 'https://yourwebsite.com';

// Create a basic HTTP authentication header
const authHeader = {
  auth: {
    username: cPanelUsername,
    password: cPanelPassword,
  },
};

// Make an HTTP GET request to the website
axios.get(websiteUrl, authHeader)
  .then(response => {
    console.log('Website content:', response.data);
  })
  .catch(error => {
    console.error('Error accessing the website:', error.message);
  });
Leave a Comment