budibase/packages/server/scripts/load/create-many-apps.js

25 lines
479 B
JavaScript
Raw Permalink Normal View History

#!/bin/node
const { createApp } = require("./utils")
const APP_COUNT = 100
if (!process.argv[2]) {
console.error("Please specify an API key as script argument.")
process.exit(-1)
}
async function run() {
for (let i = 0; i < APP_COUNT; i++) {
const app = await createApp(process.argv[2])
console.log(`App created: ${app._id}`)
}
}
run()
.then(() => {
console.log(`Finished creating ${APP_COUNT} apps.`)
})
.catch(err => {
console.error(err)
})