mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
Pass hostname instead of host to vhost module
This commit is contained in:
parent
397792cd53
commit
a0c778f5c9
@ -14,6 +14,11 @@ import vhost = require('vhost');
|
|||||||
import log from './log-request';
|
import log from './log-request';
|
||||||
import config from './conf';
|
import config from './conf';
|
||||||
|
|
||||||
|
function extractHostname(host) {
|
||||||
|
const index = host.indexOf(':');
|
||||||
|
return index < 0 ? host : host.substr(0, index);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init app
|
* Init app
|
||||||
*/
|
*/
|
||||||
@ -53,9 +58,11 @@ app.use((req, res, next) => {
|
|||||||
/**
|
/**
|
||||||
* Register modules
|
* Register modules
|
||||||
*/
|
*/
|
||||||
app.use(vhost(`api.${config.host}`, require('./api/server')));
|
const hostname = extractHostname(config.host);
|
||||||
app.use(vhost(config.secondary_host, require('./himasaku/server')));
|
const secondaryHostname = extractHostname(config.secondary_host);
|
||||||
app.use(vhost(`file.${config.secondary_host}`, require('./file/server')));
|
app.use(vhost(`api.${hostname}`, require('./api/server')));
|
||||||
|
app.use(vhost(secondaryHostname, require('./himasaku/server')));
|
||||||
|
app.use(vhost(`file.${secondaryHostname}`, require('./file/server')));
|
||||||
app.use(require('./web/server'));
|
app.use(require('./web/server'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user