var express = require('express');
var router = express.Router();

var fs    = require('fs');
var nconf = require('nconf');

/* GET home page. */
router.get('/:id', function(req, res, next) {

  nconf.file({ file:'config.json' });
  console.log(nconf.get('configuration').servers[0].name);
  res.render('index', { title: 'Zone Admin', serverID: req.params.id });
});

router.get('/', function(req, res, next) {

  nconf.file({ file:'config.json' });
  console.log(nconf.get('configuration').servers[0].name);
  res.render('index', { title: 'Zone Admin', serverID: 0 });
});

module.exports = router;
