bizmatch-project/crawler/importUser.ts

14 lines
407 B
TypeScript

import fs from 'fs-extra';
(async () => {
const listings = await fs.readJson('./users.json');
//listings.forEach(element => {
for (const listing of listings) {
const response = await fetch('http://localhost:3000/bizmatch/user', {
method: 'POST',
body: JSON.stringify(listing),
headers: { 'Content-Type': 'application/json' },
});
}
})();