router.get('/login', function(req, res, next) {
gw_address = req.query.gw_address;
gw_port = req.query.gw_port;
led.on("ok");
res.header("Cache-Control", "no-cache, no-store, must-revalidate");
res.header("Pragma", "no-cache");
res.header("Expires", 0);
if(node_red_flag == 0){
node_red_flag = 1;
request('http://127.0.0.1:1880', function (error, response, body) {});
}
fs.readFile(config.admin.file, 'utf8', function (err, data) {
if(data !=""){
res.render('begin', { title: 'WIFI authentication' });
}
else{
res.render('index', { title: 'WIFI authentication' });
}
});
});