var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function (req, res, next) { const categorys = ["web development", "applications", "web design"]; const entry = [ { category: categorys[0], img: "/images/logo.png", title: "Title 0", des: "desc", link: "#" }, { category: categorys[1], img: "/images/logo.png", title: "Title 1", des: "desc", link: "#" }, { category: categorys[2], img: "/images/logo.png", title: "Title 2", des: "desc", link: "#" } ]; res.render('main/2_0', { title: 'Nikola Petrov', disableBootStrap: true, categorys, entry }); }); router.get('/old', function (req, res, next) { res.render('main/1_0', { title: 'Nikola Petrov' }); }); router.get('/mail', function (req, res, next) { res.redirect('https://privateemail.com/'); }); router.get('/list', function (req, res, next) { res.render('list', { title: 'List' }); }); router.get('/cash', function (req, res, next) { res.render('cash', { title: 'Cash' }); }); router.get('/wake', function (req, res, next) { res.render('wake', { title: 'Cash' }); }); const checkAuthenticated = require('../middleware/checkAuthenticated.js'); const wakeOnLan = require('@mi-sec/wol'); router.post('/wake', checkAuthenticated, function (req, res) { wakeOnLan(req.user.mac_address, { address: '255.255.255.255', packets: 1, interval: 100, port: 9 }); res.render('wake', { message: 'Waking up' }); }); const userRouter = require('./user'); //router.use('/user', userRouter); module.exports = router;