aboutsummaryrefslogtreecommitdiff
path: root/src/config.ts
blob: d4527d994d2dd7ce08060480ca66a9a6dc3a5719 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import * as IO from "fp-ts/IO";
import type { Publisher } from "./publisher";
import { readFileSync } from "fs";
import type { Test } from "./canary";

export interface Config {
  result_publishers: Publisher[];
  dns: string[];
  http_timeout: string;
  tests: Test[];
}

export const readConfig =
  (filePath: string): IO.IO<Config> =>
  () => {
    const confStr = readFileSync(filePath, "utf-8");
    return JSON.parse(confStr);
  };