как я могу маршрут ниже URL для другой точки зрения в node.jsNodeJS маршрутизации вопрос
http://admin.localhost:3000/users/customer/view
и
http://localhost:3000/users/customer/view
В настоящее время он идти к тому же маршруту, что я установил для
App.js
....
var users = require('./routes/users');
app.use('/users', users);
....
Users.js
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
router.get('/Customer/Create', function(req, res, next) {
res.render('customer', {});
});
router.get('/Customer/View', function(req, res, next) {
res.render('customer', {});
});
router.get('/Employee/Create', function(req, res, next) {
res.render('customer', {});
});
router.get('/Employee/View', function(req, res, next) {
res.render('customer', {});
});
module.exports = router;
и что терминология для делать что-то подобное с URL, добавив администратора, прежде чем URL-адрес администратора. yoururl.com?
Вы должны иметь 'суб-domain' – Rayon
Это выглядит как дубликат: https://stackoverflow.com/questions/5791260/how-can-i-configure-multiple-sub-domains-in-express-js-or-connect-js – acolve