mirror of
https://github.com/sasjs/server.git
synced 2026-01-08 23:10:05 +00:00
fix: added db seed at server startup
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import mongoose from 'mongoose'
|
||||
import { populateClients } from '../routes/api/auth'
|
||||
import { seedDB } from './seedDB'
|
||||
|
||||
export const connectDB = async () => {
|
||||
export const connectDB = () => {
|
||||
// NOTE: when exporting app.js as agent for supertest
|
||||
// we should exclude connecting to the real database
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
@@ -19,6 +20,8 @@ export const connectDB = async () => {
|
||||
|
||||
console.log('Connected to db!')
|
||||
|
||||
await seedDB()
|
||||
|
||||
await populateClients()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user