This file contains 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
/** | |
* Sid Barrack | |
* | |
* the issues identified are commented below with the correct implementation | |
*/ | |
import { Suspense, useState, useEffect } from 'react'; | |
/* | |
data needs to be outside of the component, because once the promise resolves(see comment on data loading component below), |
This file contains 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
//loading modules | |
const cheerio = require('cheerio'); | |
const puppeteer = require('puppeteer'); | |
const {Cluster} = require('puppeteer-cluster'); | |
const XLSX = require('xlsx'); | |
(async () => { | |
//launching the browser in full mode using headless : false | |
const browser = await puppeteer.launch({ | |
headless: false | |
}); |
This file contains 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 mongoose = require('mongoose'); | |
var userSchema = mongoose.Schema({ | |
email : String, | |
password : String, | |
role : String | |
}); | |
var User = mongoose.model('User', userSchema); |
This file contains 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 bodyParser = require('body-parser'); | |
const session = require('express-session'); | |
const app = express(); | |
// Configuring the database | |
const dbConfig = require('./database.config.js'); | |
const mongoose = require('mongoose'); | |
const User = require('./model') |