use envs for secrets
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import _ from "../env.js";
|
||||
import { createClient as createClickhouseClient } from "@clickhouse/client";
|
||||
import type { DataFormat } from "@clickhouse/client";
|
||||
import { Env } from "@humanwhocodes/env";
|
||||
|
||||
const env = new Env();
|
||||
|
||||
const { CLICKHOUSE_USER, CLICKHOUSE_PASS } = env.required;
|
||||
const CLICKHOUSE_HOST = env.get("CLICKHOUSE_HOST", "http://localhost:8123");
|
||||
|
||||
// prevent from tree-shaking:
|
||||
console.log(_);
|
||||
export const clickhouse = createClickhouseClient({
|
||||
host: process.env.CLICKHOUSE_HOST || "http://localhost:8123",
|
||||
username: "avraham",
|
||||
password: "buginoo",
|
||||
host: CLICKHOUSE_HOST,
|
||||
username: CLICKHOUSE_USER,
|
||||
password: CLICKHOUSE_PASS,
|
||||
});
|
||||
|
||||
export async function query<T>(
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
// import pThrottle from "p-throttle";
|
||||
import pRetry from "p-retry";
|
||||
import { Env } from "@humanwhocodes/env";
|
||||
|
||||
const apiKey = "H95NTsatM1iTWLUwDLxM2J5zhUVYdCEz";
|
||||
const env = new Env();
|
||||
|
||||
const { POLYGON_API_KEY } = env.required;
|
||||
|
||||
const apiKey = POLYGON_API_KEY;
|
||||
// export const getApiKey = pThrottle({ limit: 5, interval: 60000 })(() => apiKey);
|
||||
export const getApiKey = () => apiKey;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user