Use host instead of hostname

This commit is contained in:
Armin 2019-03-25 15:33:53 +01:00
parent b6b8f073b8
commit f2735e6275

View File

@ -33,9 +33,7 @@ export default class ActivityPub {
if (!activityPub) {
dotenv.config()
const url = new URL(process.env.GRAPHQL_URI)
// TODO Check why the hostname attribute in the prod env not containing the tld! Following line is a quick fix!!
const hostname = url.hostname.endsWith('.org') || url.hostname.indexOf('localhost') > -1 ? url.hostname : url.hostname.concat('.org')
activityPub = new ActivityPub(hostname || 'localhost', url.port || 4000, url.origin)
activityPub = new ActivityPub(url.host || 'localhost', url.port || 4000, url.origin)
// integrate into running graphql express server
server.express.set('ap', activityPub)