import { Injectable } from "@nestjs/common";
import { readFileSync } from "fs";
import { join } from "path";

@Injectable()
export class ReadJsonService {
  json: any;
  constructor() {
    const jsonPath = join("..", "JSON", "records.json");
    const jsonObj = JSON.parse(readFileSync(jsonPath).toString());
    this.json = jsonObj;
  }
  getAll() {
    return this.json;
  }
}
