move list, mail, user router to main

This commit is contained in:
Nikola Petrov 2023-09-24 20:39:05 +02:00
parent cab04596e8
commit 66c01a350d
4 changed files with 11 additions and 25 deletions

6
app.js
View File

@ -43,16 +43,10 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
var mainRouter = require('./routes/main'); var mainRouter = require('./routes/main');
var listRouter = require('./routes/list');
var apiRouter = require('./routes/api/apiRouter'); var apiRouter = require('./routes/api/apiRouter');
var mailRouter = require('./routes/mail');
//var userRouter = require('./routes/user');
app.use('/', mainRouter); app.use('/', mainRouter);
app.use('/list', listRouter);
app.use('/api', apiRouter); app.use('/api', apiRouter);
app.use('/mail', mailRouter);
//app.use('/user', userRouter);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function (req, res, next) { app.use(function (req, res, next) {

View File

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('list', {title: 'List'});
});
module.exports = router;

View File

@ -1,10 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function (req, res, next) {
res.redirect('https://privateemail.com/');
});
module.exports = router;

View File

@ -10,4 +10,15 @@ router.get('/old', function (req, res, next) {
res.render('main/1_0', { title: 'Nikola Petrov' }); 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'});
});
const userRouter = require('./user');
//router.use('/user', userRouter);
module.exports = router; module.exports = router;