Skip to content

Commit

Permalink
Merge pull request #8 from Luxshan2000/main
Browse files Browse the repository at this point in the history
Pull from main to paymentGateway
  • Loading branch information
OshnMdw authored Oct 18, 2023
2 parents bd900e5 + adae093 commit 0424b61
Show file tree
Hide file tree
Showing 42 changed files with 7,140 additions and 1,059 deletions.
2 changes: 1 addition & 1 deletion backend/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PORT = 5000
MONGODB_CONNECTION_URL = "mongodb+srv://sldrivesmart:[email protected]/drivesmart?retryWrites=true&w=majority"
SECURITY_KEY = "DRIVESMART--Oshan--Kamadi--Luxshan--DRIVESMART"
EMAIL_KEY = 'PUT THE KEY'
EMAIL_KEY = 'rnbj lcxl nhxd iwsw'
2 changes: 2 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# production
/build

/backend/.env

# misc
.DS_Store
.env.local
Expand Down
43 changes: 42 additions & 1 deletion backend/config/database.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require('dotenv').config();
const mongoose = require("mongoose")
const mongoose = require("mongoose");
const Topic = require('../src/models/topic');
const Question = require('../src/models/questions')


const connectMongoDb = ()=>{
Expand All @@ -10,6 +12,45 @@ const connectMongoDb = ()=>{
console.log('====================================');
console.log("mongoDB is sucessfully connected!");
console.log('====================================');

/*Debugging Purpose*/
// const sample = async ()=>{
// const title = "What are the ways to apply License?"
// const no = 3
// const videoUrl = "videourl"
// const script = '<h1 >This is an script</h1>'
// const questions = [
// {
// ques: "Question 1",
// answer: "Answer 1",
// posFeedback: "Correct!",
// negativeFeedback: "Sorry, wrong answer.",
// options: ["Option A", "Option B", "Option C"],
// correctOption: "Option B"
// },
// {
// ques: "Question 2",
// answer: "Answer 2",
// posFeedback: "Good job!",
// negativeFeedback: "Try again.",
// options: ["Option X", "Option Y", "Option Z"],
// correctOption:"Option X"
// }
// // Add more questions as needed
// ]


// const topic = new Topic({title,no,videoUrl, script, questions })

// await topic.save()
// }

// sample()





}).catch((error)=>{
console.log('====================================');
console.log("mongoDB configration error\n",error);
Expand Down
Loading

0 comments on commit 0424b61

Please sign in to comment.