var express = require('express');
var path = require('path');
var router = express.Router();
var adminOrderRouter = require(path.join(__dirname, 'adminOrderController'));
var adminBagRouter = require(path.join(__dirname, 'adminBagController'));
/* GET home page. */
router.get('/',
require('connect-ensure-login').ensureLoggedIn(),
function (req, res, next) {
// res.json(req.user);
res.render('index', {
slideMenu: {
user: req.user,
menus: ["home"]
},
user: req.user
});
});
router.use('/order', adminOrderRouter);
router.use('/bag', adminBagRouter);
module.exports = router;
for example I access sub-domain from http://admin.app.dev
The problem is I can access main domain form http://admin.app.dev/login or http://admin.app.dev/finance which is not define in sub-domain router context.
I have define following main domain and sub domain
which adminIndexRouter is
for example I access sub-domain from
http://admin.app.dev
The problem is I can access main domain form
http://admin.app.dev/login
orhttp://admin.app.dev/finance
which is not define in sub-domain router context.