diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-03-26 14:15:19 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-26 14:15:19 +0900 |
| commit | ca78cbc7ebcfcbb9a8abc9647aa56aa6096ff619 (patch) | |
| tree | 52db81919b83e2bbd163434fca3e72a0ebf3af2c /src/server.ts | |
| parent | Merge pull request #1291 from rinsuki/fix/using-whatwg-url-api (diff) | |
| parent | Define hostname and secondary_hostname in config (diff) | |
| download | misskey-ca78cbc7ebcfcbb9a8abc9647aa56aa6096ff619.tar.gz misskey-ca78cbc7ebcfcbb9a8abc9647aa56aa6096ff619.tar.bz2 misskey-ca78cbc7ebcfcbb9a8abc9647aa56aa6096ff619.zip | |
Merge pull request #1292 from akihikodaki/config
Define hostname and secondary_hostname in config
Diffstat (limited to 'src/server.ts')
| -rw-r--r-- | src/server.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/server.ts b/src/server.ts index 84e8c41489..7f66c42073 100644 --- a/src/server.ts +++ b/src/server.ts @@ -14,11 +14,6 @@ import vhost = require('vhost'); import log from './log-request'; import config from './conf'; -function extractHostname(host) { - const index = host.indexOf(':'); - return index < 0 ? host : host.substr(0, index); -} - /** * Init app */ @@ -58,11 +53,9 @@ app.use((req, res, next) => { /** * Register modules */ -const hostname = extractHostname(config.host); -const secondaryHostname = extractHostname(config.secondary_host); -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(vhost(`api.${config.hostname}`, require('./api/server'))); +app.use(vhost(config.secondary_hostname, require('./himasaku/server'))); +app.use(vhost(`file.${config.secondary_hostname}`, require('./file/server'))); app.use(require('./web/server')); /** |