-
Notifications
You must be signed in to change notification settings - Fork 0
/
routesapi.js
23 lines (22 loc) · 1.53 KB
/
routesapi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const CandidatesApi = require('./app/api/candidatesapi');
const UsersApi = require('./app/api/usersapi');
const DonationsApi = require('./app/api/donationsapi');
const utils = require('./app/api/utils.js');
module.exports = [
{ method: 'GET', path: '/api/candidates', config: CandidatesApi.find },
{ method: 'GET', path: '/api/candidates/{id}', config: CandidatesApi.findOne },
{ method: 'POST', path: '/api/candidates', config: CandidatesApi.create },
{ method: 'DELETE', path: '/api/candidates/{id}', config: CandidatesApi.deleteOne },
{ method: 'DELETE', path: '/api/candidates', config: CandidatesApi.deleteAll },
{ method: 'GET', path: '/api/users', config: UsersApi.find },
{ method: 'GET', path: '/api/users/{id}', config: UsersApi.findOne },
{ method: 'POST', path: '/api/users', config: UsersApi.create },
{ method: 'DELETE', path: '/api/users/{id}', config: UsersApi.deleteOne },
{ method: 'DELETE', path: '/api/users', config: UsersApi.deleteAll },
{ method: 'GET', path: '/api/donations', config: DonationsApi.findAllDonations },
{ method: 'GET', path: '/api/candidates/{id}/donations', config: DonationsApi.findDonations },
{ method: 'POST', path: '/api/candidates/{id}/donations', config: DonationsApi.makeDonation },
{ method: 'DELETE', path: '/api/donations', config: DonationsApi.deleteAllDonations },
{ method: 'DELETE', path: '/api/candidates/{id}/donations', config: DonationsApi.deleteDonations },
{ method: 'POST', path: '/api/users/authenticate', config: UsersApi.authenticate },
];