Skip to content

Commit

Permalink
fix: 🔧 revert use node process
Browse files Browse the repository at this point in the history
  • Loading branch information
doneber committed Mar 19, 2024
1 parent 63bde44 commit 4eadab8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/pages/api/resources.json.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import fs from "node:fs/promises"
import path from "node:path"
import process from "node:process"
import { getTittleFromUrl, parseCsvToObjects } from "@src/utils/utils"
import { getResources, getTittleFromUrl } from "@src/utils/utils"
import type { APIRoute } from "astro"
import cheerio from "cheerio"
import Fuse from "fuse.js"

const filePath = path.resolve(process.cwd(), "public", "resources.csv")
// const filePath = path.resolve(process.cwd(), "public", "resources.csv")

// const csvText = await fs.readFile(filePath, "utf-8")
// const resources = parseCsvToObjects(csvText)

const CSV_URL = "https://raw.githubusercontent.com/doneber/linkhub/main/public/resources.csv"

const resources = await getResources(CSV_URL)

const csvText = await fs.readFile(filePath, "utf-8")
const resources = parseCsvToObjects(csvText)
const getMetadata = async (url: string) => {
try {
const response = await fetch(url)
Expand Down

0 comments on commit 4eadab8

Please sign in to comment.