index.js 579 Bytes
// index.js

var express = require('express');
var app = express();


app.set("view engine","ejs"); // 1
app.use(express.static(__dirname + '/public'));

// 2
app.use(express.json())

app.get("/index", function(req,res){
  res.render("index");
});

app.get('/graph', function(req, res){
  var payDay = req.query.payDay
  var salary  = req.query.salary
  var workDay  = req.query.workDay
  var workTime = req.query.workTime
  var offWork  = req.query.offWork
  res.sendFile(__dirname + '/public/graph.html');
  })

app.listen(3000, function(){
  console.log('Server On!');
});