feat: Development server for core + plugins (#2448)
This commit is contained in:
committed by
GitHub
parent
4de4f20b46
commit
b88cef2b1f
31
integration-tests/development/create-database.js
Normal file
31
integration-tests/development/create-database.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const path = require("path")
|
||||
|
||||
require("dotenv").config({ path: path.join(__dirname, ".env.development") })
|
||||
|
||||
const { initDb } = require("./use-db-development")
|
||||
|
||||
require("./dev-require")
|
||||
|
||||
const seedDB = async (db) => {
|
||||
const seeder = require("./database/index.js")
|
||||
try {
|
||||
await seeder(db)
|
||||
} catch (err) {
|
||||
console.log("Error", err)
|
||||
}
|
||||
}
|
||||
|
||||
const start = async () => {
|
||||
console.log("Creating DB...")
|
||||
const dbConnection = await initDb()
|
||||
console.log("Creating DB. DONE")
|
||||
|
||||
console.log("Seeding DB...")
|
||||
await seedDB(dbConnection)
|
||||
console.log("Seeding DB... DONE")
|
||||
|
||||
await dbConnection.close()
|
||||
process.exit()
|
||||
}
|
||||
|
||||
start()
|
||||
Reference in New Issue
Block a user