Skip to content
Snippets Groups Projects
Commit c779858d authored by Matt Kirby's avatar Matt Kirby
Browse files

Merge branch 'mongo-seeder-v2' of...

Merge branch 'mongo-seeder-v2' of https://gitlab.surrey.ac.uk/com3014-coursework/daily-thought-app into mongo-seeder-v2
parents a1ba253d 4271f047
No related branches found
No related tags found
1 merge request!31Implement Mongo Seeder v2
Pipeline #46315 passed with stage
in 1 minute and 26 seconds
This commit is part of merge request !31. Comments created here will be created in the context of that merge request.
......@@ -35,9 +35,9 @@ object QuestionRepository {
println("Seeding Question Database...")
try {
Question.createQuestionAsync("Who is there?")
Question.createQuestionAsync("How is that there?")
Question.createQuestionAsync("Where is there?")
Question.createQuestionAsync("What is your favourite food?")
Question.createQuestionAsync("What is your dream holiday destination?")
Question.createQuestionAsync("What us your favourite local spot?")
println("Successfully seeded Question Database!")
} catch {
......
......@@ -29,7 +29,8 @@ connect().then(async () => {
// Database Seeding
if (process.env.ENABLE_USER_DB_SEEDING) {
try {
const hashedPassword = await bcrypt.hash("password", 10);
const password = process.env.SEEDED_ADMIN_PASSWORD
const hashedPassword = await bcrypt.hash(password, 10);
const admin = new UserModel({
username: "admin",
......
......@@ -33,6 +33,7 @@ services:
- MONGO_URI=mongodb://user-mongo:27017/userdb
- JWT_PRIVATE_KEY=yB/uX5KdyjHN9P34IE49HxAcrlQ4gfvpVJEzGbo5E/I=
- ENABLE_USER_DB_SEEDING=true
- SEEDED_ADMIN_PASSWORD=doesntreallymatter
friend-service:
build:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment