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