-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouter.js
More file actions
17 lines (15 loc) · 767 Bytes
/
router.js
File metadata and controls
17 lines (15 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const Bookings = require('./routes/bookings')
const Profile = require('./routes/profile')
const Authentication = require('./controllers/authentication')
const passportService = require('./services/passport')
const passport = require('passport')
const requireAuth = passport.authenticate('jwt', { session: false })
const requireSignin = passport.authenticate('local', { session: false })
module.exports = function(app) {
app.post('/api/getUser', requireAuth, Profile.getUser)
app.post('/auth/signin', requireSignin, Authentication.signin)
app.post('/auth/signup', Authentication.signup)
app.post('/api/book', requireAuth, Bookings.book)
app.post('/api/cancel', requireAuth, Bookings.cancel)
app.post('/api/updateUser', requireAuth, Profile.updateUser)
}