app.js 824 Bytes
const http = require('http');
const express = require('express');
const fs = require('fs');
const schedule = require('node-schedule');
const spawn = require('child_process').spawn;
const { rawListeners } = require('process');
var port = 23023;

var app = express();
var router = require('./index')(app);

app.set('port', port);
app.set('views', __dirname + '/static');
app.set('view engine', 'ejs');
app.engine('html', require('ejs').renderFile);

app.use(express.static(__dirname + '/static'));

function update() {
  console.log('Updating . . .');
  var getdata = spawn('python3', ["run.py"])
  getdata.stdout.on('data', function(data) {
    console.log(data.toString());
  })
}
setInterval(update, 1000 * 60 * 60 * 2)

var server = http.createServer(app).listen(port, function(){
  console.log("Server Running . . .");
})