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
$(document).ready(function () { | |
/*global io*/ | |
let socket = io(); | |
// Form submittion with new message in field with id 'm' | |
$('form').submit(function () { | |
var messageToSend = $('#m').val(); | |
$('#m').val(''); | |
return false; // prevent form submit from refreshing page |
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 passport = require('passport'); | |
const LocalStrategy = require('passport-local'); | |
const bcrypt = require('bcrypt'); | |
const { ObjectID } = require('mongodb'); | |
const GitHubStrategy = require('passport-github').Strategy; | |
module.exports = function (app, myDataBase) { | |
passport.serializeUser((user, done) => { | |
done(null, user._id); | |
}); |
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 passport = require('passport'); | |
const LocalStrategy = require('passport-local'); | |
const bcrypt = require('bcrypt'); | |
const { ObjectID } = require('mongodb'); | |
const GitHubStrategy = require('passport-github').Strategy; | |
module.exports = function (app, myDataBase) { | |
passport.serializeUser((user, done) => { | |
done(null, user._id); | |
}); |
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 passport = require('passport'); | |
const bcrypt = require('bcrypt'); | |
module.exports = function (app, myDataBase) { | |
app.route('/').get((req, res) => { | |
res.render('index', { | |
title: 'Connected to Database', | |
message: 'Please log in', | |
showLogin: true, | |
showRegistration: true, |
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 passport = require('passport'); | |
const LocalStrategy = require('passport-local'); | |
const bcrypt = require('bcrypt'); | |
const { ObjectID } = require('mongodb'); | |
module.exports = function (app, myDataBase) { | |
passport.serializeUser((user, done) => { | |
done(null, user._id); | |
}); | |
passport.deserializeUser((id, done) => { |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const { ObjectID } = require('mongodb'); | |
const LocalStrategy = require('passport-local'); | |
const bcrypt = require('bcrypt'); |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const { ObjectID } = require('mongodb'); | |
const LocalStrategy = require('passport-local'); |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const { ObjectID } = require('mongodb'); | |
const LocalStrategy = require('passport-local'); |
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
html | |
head | |
title FCC Advanced Node and Express | |
meta(name='description', content='Profile') | |
meta(charset='utf-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
meta(name='viewport', content='width=device-width, initial-scale=1') | |
link(rel='stylesheet', href='/public/style.css') | |
body | |
h1.border.center FCC Advanced Node and Express Profile |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const { ObjectID } = require('mongodb'); | |
const LocalStrategy = require('passport-local'); |