controller.js 698 Bytes
var express = require('express');
var app = express();
var fs = require('fs')
var Businfo = require("../models/BusInfo");

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

exports.mainView = function(req, res) {
    res.render("index.ejs")
}//main 화면

exports.timeTable = function(req, res) {
    res.render("ejstest.ejs",{busNum:req.query.busNum, remainTime: Businfo.data.remainTime, ETD_min_H: Businfo.data.ETD_min_H,
        ETD_min_m: Businfo.data.ETD_max_m, ETD_max_H: Businfo.data.ETD_max_H, ETD_max_m: Businfo.data.ETD_max_m });
} //timeTable 화면 ejs 변수 렌더링