-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
const express = require('express'); | ||
const actions = require('../methods/actions'); | ||
const auth = require('../methods/auth'); | ||
const client = require('../methods/client'); | ||
const oauth2 = require('../methods/oauth2'); | ||
const actions = require('../controller/actions'); | ||
const auth = require('../controller/auth'); | ||
const client = require('../controller/client'); | ||
const oauth2 = require('../controller/oauth2'); | ||
|
||
const router = express.Router(); | ||
|
||
// User | ||
router.post('/authenticate', actions.authenticate); | ||
router.post('/adduser', actions.addNew); | ||
router.get('/getinfo', actions.getinfo); | ||
router.post('/authenticate', actions.authenticate); // Authenticate user | ||
router.post('/adduser', actions.addNew); // Create New User | ||
router.get('/getinfo', actions.getinfo); // Retrive All Users | ||
|
||
// Client routes | ||
router.post('/clients', auth.isAuthenticated, client.postClients); | ||
router.get('/clients', auth.isAuthenticated, client.getClients); | ||
router.post('/clients', auth.isAuthenticated, client.postClients); // Create New User | ||
router.get('/clients', auth.isAuthenticated, client.getClients); // Authenticate client | ||
|
||
// Oauth routes | ||
router.get('/oauth2/authorize', oauth2.authorization); | ||
router.post('/oauth2/authorize', oauth2.decision); | ||
router.get('/oauth2/authorize', oauth2.authorization); // Ask for permission | ||
router.post('/oauth2/authorize', oauth2.decision); // Retrive the code from url | ||
|
||
// Exchange code with token | ||
router.post('/oauth2/token', auth.isClientAuthenticated, oauth2.token); | ||
router.post('/oauth2/token', auth.isClientAuthenticated, oauth2.token); // Generate token | ||
|
||
// Accessing/modifying the resourse | ||
router.post('/addBook', auth.isBearerAuthenticated, actions.addBook); | ||
router.get('/getBooks', auth.isBearerAuthenticated, actions.getBook); | ||
router.post('/addBook', auth.isBearerAuthenticated, actions.addBook); // Add books | ||
router.get('/getBooks', auth.isBearerAuthenticated, actions.getBook); // Get Books | ||
|
||
module.exports = router; |
This file contains 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