Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull from main to paymentGateway #8

Merged
merged 25 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading