Use proto schema based on current connection
This commit is contained in:
parent
4b372876ef
commit
9c0b7b542d
1 changed files with 4 additions and 3 deletions
7
app.js
7
app.js
|
@ -4,6 +4,7 @@ const logger = require('morgan');
|
|||
const cookieParser = require('cookie-parser');
|
||||
const bodyParser = require('body-parser');
|
||||
const sassMiddleware = require('node-sass-middleware');
|
||||
const protocol = require("./src/utils/connection");
|
||||
// const favicon = require('serve-favicon');
|
||||
|
||||
const subdomain = require('express-subdomain');
|
||||
|
@ -35,9 +36,9 @@ app.use(sassMiddleware({
|
|||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.locals.uonetplusUrl = "http://" + req.get('host').replace("uonetplus-opiekun", "uonetplus");
|
||||
res.locals.currentHost = "http://" + req.get('host');
|
||||
res.locals.mainHost = "http://" + req.get('host')
|
||||
res.locals.uonetplusUrl = protocol(req) + "://" + req.get('host').replace("uonetplus-opiekun", "uonetplus");
|
||||
res.locals.currentHost = protocol(req) + "://" + req.get('host');
|
||||
res.locals.mainHost = protocol(req) + "://" + req.get('host')
|
||||
.replace(/(api|cufs|uonetplus|uonetplus-opiekun|uonetplus-uzytkownik)\./, "");
|
||||
next();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue