-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
43 lines (25 loc) · 829 Bytes
/
routes.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
const express = require('express')
const router = express.Router()
const controller = require('./controller')
const passport = require('passport')
const auth = require('./auth/auth')
router.route('/auth/facebook')
.get(passport.authenticate('facebook'))
router.route('/auth/facebook/callback')
.get(passport.authenticate('facebook', {
failureRedirect : '/'}),
controller.login
)
router.route('/bars')
.post(controller.getBars)
router.route('/users')
.get(controller.getUsers)
router.route('/going')
.put(controller.isAuthenticated,controller.toggle_going)
router.route('/delete')
.get(controller.deleteUsers)
router.route('/user')
.get(controller.getUser)
router.route('/logout')
.get(controller.logout)
module.exports= router