Resources for learning web design & front-end development:
ONLINE
Design
Resources for learning web design & front-end development:
ONLINE
Design
'use strict'; | |
// Imports dependencies and set up http server | |
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN; | |
const | |
express = require('express'), | |
bodyParser = require('body-parser'), | |
request = require('request'), | |
app = express().use(bodyParser.json()); // creates express http server |
$ make prepare-mobile | |
make[1]: Entering directory '/home/emmanuel/oss-projects/status-react' | |
scripts/prepare-for-platform.sh android | |
******************************************************************************************** | |
The current environment doesn't contain the expected versions of node and/or yarn | |
- node: expected v10.12.0 | |
found v8.12.0 (/usr/bin/node) | |
- yarn: expected 1.13.0 | |
found 1.13.0 (/usr/bin/yarn) |
scripts/run-environment-check.sh android | |
Finished! | |
react-native run-android --appIdSuffix debug | |
Scanning folders for symlinks in /home/emmanuel/oss-projects/status-react/node_modules (168ms) | |
Starting JS server... | |
Building and installing the app on the device (cd android && ./gradlew installDebug)... | |
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details | |
> Configure project :app | |
Reading env from: .env |
const passport = require('passport'); | |
const Strategy = require('passport-facebook').Strategy; | |
require('dotenv').config(); | |
// Configure Passport authenticated session persistence. | |
passport.serializeUser(function(user, cb) { | |
cb(null, user); | |
}); | |
passport.deserializeUser(function(obj, cb) { |
// Configure the Facebook strategy for use by Passport. | |
passport.use(new Strategy({ //This is class constructor argument telling Passport to create a new Facebook Auth Strategy | |
clientID: process.env['FACEBOOK_CLIENT_ID'],//The App ID generated when app was created on https://developers.facebook.com/ | |
clientSecret: process.env['FACEBOOK_CLIENT_SECRET'],//The App Secret generated when app was created on https://developers.facebook.com/ | |
callbackURL: 'http://localhost:3000/api/v1/user/return', | |
profile: ['id', 'displayName'] // You have the option to specify the profile objects you want returned | |
}, | |
function(accessToken, refreshToken, profile, done) { | |
//Check the DB to find a User with the profile.id | |
User.findOne({ facebook_id: profile.id }, function(err, user) {//See if a User already exists with the Facebook ID |
//Routes | |
//User gets here upon successful login | |
router.get('/home', (req, res) => { | |
res.json({ user: user }); | |
}); | |
//This is so you know if a Login attempt failed | |
router.get('/login', (req, res) => { | |
res.json({msg: "login failed"}); |