import _ from 'lodash' import env from '../env.ts' const domain = 'startbit.bitmill.io' type SiteConfig = { title: string name: string port: string | null hostname: string | null domain: string protocol: string localHost: string host: string | null url: string emails: Record } const defaults: SiteConfig = { title: 'startbit', name: 'startbit,', port: null, hostname: null, domain, protocol: 'http', localHost: `http://localhost:${env.PORT}`, get host() { return this.port ? `${this.hostname}:${this.port}` : this.hostname }, get url() { return `${this.protocol}://${this.host}/` }, emails: { robot: `no-reply@bitmill.io`, info: 'contact@bitmill.io', }, } export default _.merge( defaults, { development: { hostname: 'localhost', port: env.PORT, }, production: { hostname: domain, protocol: 'https', emails: { robot: `no-reply@${domain}`, info: `info@${domain}`, }, }, }[env.NODE_ENV as 'development' | 'production'], ) as SiteConfig