"use server"
import config from '../config.json' with { type: "json" };
export async function getScores(){
let scoresPath = `${config.folder}/scores.hth`;
let scores:{[fileName:string]:number} = {};
try{
let data = await Deno.readTextFile(scoresPath);
scores = JSON.parse(data);
}
catch(err){
console.log("13")
console.error("Error in scores file: ", err)
throw new Error("Error reading scores file");
}
return {scores: scores, path: config.folder};
}
"use server"
import config from '../config.json' with { type: "json" };
export async function getScores(){
let scoresPath = `${config.folder}/scores.hth`;
let scores:{[fileName:string]:number} = {};
try{
let data = await Deno.readTextFile(scoresPath);
scores = JSON.parse(data);
}
catch(err){
console.log("13")
console.error("Error in scores file: ", err)
throw new Error("Error reading scores file");
}
return {scores: scores, path: config.folder};
}