Created
June 19, 2020 20:05
-
-
Save lakshaygupta21/e0c5871de746d237f24c6c2e8309ab85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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