feat: Development server for core + plugins (#2448)

This commit is contained in:
Carlos R. L. Rodrigues
2022-10-21 10:53:06 -03:00
committed by GitHub
parent 4de4f20b46
commit b88cef2b1f
23 changed files with 762 additions and 14 deletions

View 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()