glass-isc-dhcp/routes/dhcp_config_snapshot_view.js

12 lines
388 B
JavaScript
Raw Normal View History

var express = require('express');
var router = express.Router();
var fs = require('fs');
var template_render = require('../lib/render_template.js');
2017-09-06 11:42:05 +02:00
var authorize = require('../lib/authorize.js');
2017-09-06 11:42:05 +02:00
router.post('/', authorize.auth, function(req, res, next) {
var request = req.body;
res.send(fs.readFileSync("./config_backups/" + request.snapshot, 'utf8'));
});
module.exports = router;