var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function (req, res, next) { const entry = [ { img: "/images/projects/Advent_Of_Code_Logo.jpg", title: "Advent of code", des: "My solutions for AOC", link: "https://gitlab.com/homep/advent_of_code" }, { img: "/images/projects/password_manager.jpeg", title: "Password manager", des: "CLI app", link: "https://gitlab.com/homep/password_manager" }, { img: "/images/projects/media_player.jpeg", title: "Media player", des: "WPF", link: "https://gitlab.com/school221/semester_3/uporabniski_vmesniki" }, { img: "/images/logo.png", title: "Server", des: "Everything running on my server", link: "https://gitlab.com/homep/server" }, { img: "/images/projects/projektna_naloga.jpeg", title: "Highway Tracker", des: "School project", link: "https://gitlab.com/school221/semester_4/projektna_naloga" }, { img: "/images/projects/bitshift.jpeg", title: "BitShifters", des: "unity", link: "https://gitlab.com/school221/semester_4/razvoj_programskih_sistemov/bitshifters" }, { img: "/images/projects/tetris.jpeg", title: "Tetris", des: "WPF", link: "https://gitlab.com/school221/semester_4/razvoj_programskih_sistemov/tetrisrps" }, { img: "/images/projects/games.jpeg", title: "Games", des: "java", link: "https://gitlab.com/school221/semester_5/uvod_v_razvoj_racunalniskih_iger" } ]; res.render('main/2_0', { title: 'Nikola Petrov', disableBootStrap: true, 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;