-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
53 lines (45 loc) · 1.56 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const path = require('path')
const ENVS = path.join(__dirname, 'envvars')
require('dotenv').config({ path: ENVS })
const Chewb = require('chewb-server')
const ChewbPassport = require('chewb-passport')
let server = new Chewb(ENVS)
const Peer = require('./peer')
let strats = [{
name: 'facebook',
clientId: process.env.FACEBOOK_ID,
clientSecret: process.env.FACEBOOK_SECRET,
authUrl: '/login/facebook',
redirectUrl: '/login/facebook/return',
callbackUrl: `http://localhost:${process.env.EXPRESS_PORT}/login/facebook/success`
}, {
name: 'instagram',
scope: ['public_content'],
clientId: process.env.INSTAGRAM_ID,
clientSecret: process.env.INSTAGRAM_SECRET,
authUrl: '/login/instagram',
redirectUrl: '/login/instagram/return',
callbackUrl: `http://localhost:${process.env.EXPRESS_PORT}/login/instagram/success`
}, {
name: 'youtube',
scope: [
"https://www.googleapis.com/auth/youtube.upload",
"https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtubepartner",
'https://www.googleapis.com/auth/youtube.readonly',
'https://www.googleapis.com/auth/youtube.force-ssl'
],
clientId: process.env.YOUTUBE_ID,
clientSecret: process.env.YOUTUBE_SECRET,
authUrl: '/login/youtube',
redirectUrl: '/login/youtube/return',
callbackUrl: `http://localhost:${process.env.EXPRESS_PORT}/login/youtube/success`
}]
let chewbPassport = new ChewbPassport(
server.app,
strats, {
host: `http://${server.host}:${server.port}/`,
baseRoute: '',
logOut: true
})
const peer = Peer(server.app, server.server, server.io)