Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let cron = require('node-cron')
let shell = require('shelljs')
var express = require('express')
var app = express()
app.get('/', function(req, res) {
res.redirect("https://www.youtube.com/watch?v=wYOA4waoWog")
})
cron.schedule("8 17,25,34,42,51,59 * * * *", function() {
console.log('scheduler running...')
if (shell.exec('node server.js').code !== 0) {
console.log('Something went wrong ')
}
})
app.listen(process.env.PORT || 3000, () => console.log(`Server started on port 3000`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.