ML-Learner / Backend_node /temperarydatainsertion.js
VashuTheGreat2's picture
Upload folder using huggingface_hub
c01955c verified
const url="http://localhost:3000/api/question/add_questions"
import fs from "fs"
const content=fs.readFileSync("./problems.json")
const data=JSON.parse(content)
data.forEach(async element => {
const response=await fetch(url,{
method:"POST",
headers:{
"Content-Type":"application/json"
},
body:JSON.stringify(element)
})
});
console.log("Data inserted Successfully")