This text is italic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const app = express(); | |
| const exphbs = require('express-handlebars'); | |
| const favicon = require('express-favicon'); | |
| const bodyParser = require('body-parser'); | |
| const mongoose = require('mongoose'); | |
| const expressValidator = require('express-validator'); | |
| const session = require('express-session'); | |
| const cookieParser = require('cookie-parser'); | |
| const flash = require('connect-flash'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const fs = require('fs); | |
| const multer = require('multer'); | |
| const router = express.Router(); | |
| let gridfs; | |
| let Image; | |
| const storage = multer.diskStorage({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //The below model is used to book a travel ride. | |
| //The uploaded file is parsed in the formidable multipart body parser and stored in req.files.fileField. | |
| //File is read from , in my code, req.files.file | |
| var rideModel = function(){ | |
| var rideSchema = new Schema({ | |
| email : String, | |
| corp_id : String, | |
| name : String, | |
| manager: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "question": "What temperature does water boil at?", | |
| "optionA": "50 degrees Celcius", | |
| "optionB": "25 degrees Celcius", | |
| "optionC": "100 degrees Celcius", | |
| "optionD": "150 degrees Celcius", | |
| "answer": "100 degrees Celcius" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const formData = require('form-data'); | |
| const Mailgun = require('mailgun.js'); | |
| const mailgun = new Mailgun(formData); | |
| const DOMAIN = process.env.CYBERKACH_MAIL_DOMAIN; | |
| const client = mailgun.client({ | |
| username: 'api', | |
| domain: DOMAIN, | |
| key: process.env.MAILGUN_API_KEY, |