const axios = require('axios');
module.exports = {
schedule: '0 8 * * 1-5', // runs at 8am Mon-Fri
handler: async () => {
try {
// Make API call to turn on computer
await axios.post('https://api.example.com/poweron');
console.log('Computer turned on successfully!');
} catch (error) {
console.error(error);
}
}
};
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter