index.js 509 Bytes
const express = require('express');
const fs = require('fs');
const router = express.Router();

var sentiment = fs.readFileSync("sentiment.txt").toString().split('\n');
var date = fs.readFileSync("date.txt").toString();

module.exports = function(app){
     app.get('/',function(req,res){
        res.render('index.html', {
           total : sentiment[0],
           positive : sentiment[1],
           neutral : sentiment[2],
           negative : sentiment[3],
           date : date
        });
     });
}