MCPcopy Create free account
hub / github.com/dzcode-io/dzcode.io / getConfig

Function getConfig

data/src/config/index.ts:3–17  ·  view source on GitHub ↗
(
  environment: Environment = (process.env.NODE_ENV as Environment) || "development",
  extra?: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

1import { Environment, environments } from "@dzcode.io/utils/dist/config/environment";
2
3export const getConfig = (
4 environment: Environment = (process.env.NODE_ENV as Environment) || "development",
5 extra?: Record<string, unknown>,
6) => {
7 const e = environments.indexOf(environment);
8
9 const hostname = extra?.hostname || "localhost";
10 const port = 9090;
11 return {
12 port,
13 url: [`http://${hostname}:${port}`, "https://data.stage.dzcode.io", "https://data.dzcode.io"][
14 e
15 ],
16 };
17};

Callers 1

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected