/*=====================================================================*/ /* .../project/hop/3.7.x/node_modules/hop/node/config.mjs.in */ /* ------------------------------------------------------------- */ /* Author : Manuel Serrano */ /* Creation : Wed Jan 31 13:57:37 2024 */ /* Last change : Wed Jan 31 14:18:49 2024 (serrano) */ /* Copyright : 2024 Manuel Serrano */ /* ------------------------------------------------------------- */ /* Default configuration */ /*=====================================================================*/ /*---------------------------------------------------------------------*/ /* RC file */ /*---------------------------------------------------------------------*/ import { existsSync, readFileSync } from "node:fs"; import * as path from "node:path"; import * as os from "node:os"; /*---------------------------------------------------------------------*/ /* exported configuration ... */ /*---------------------------------------------------------------------*/ export const version = "@VERSION@"; export const buildid = "@BUILDTAG@"; export const hostname = os.hostname(); export let port = 8888; const rcfile = path.join(process.env.HOME, ".config", "hop", "config.json"); if (existsSync(rcfile)) { try { const cfg = JSON.parse(readFileSync(rcfile)); port = cfg?.port ?? port; } catch (e) { throw e; } }