UNPKG

lux-framework

Version:

Build scalable, Node.js-powered REST APIs with almost no code.

16 lines (13 loc) 262 B
// @flow import type { Request } from '../interfaces'; /** * @private */ export default function getDomain({ headers, connection: { encrypted } }: Request): string { return `http${encrypted ? 's' : ''}://${headers.get('host') || 'localhost'}`; }