-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.ts
69 lines (49 loc) · 1.73 KB
/
urls.ts
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import express, { Router } from 'express';
const router: Router = express.Router({ caseSensitive: true, mergeParams: true, strict: true });
const { protect, protectAdmin } = require('./middleware/auth');
const {
getUserAuthorization,
increaseAdsCount,
getAdsAndTokenCount,
requestTokenTransfer,
submitVote,
getCurrentPoll,
getCurrentProposals,
getOneProposal,
} = require('./controller/user');
const {
addNewProject,
editProject,
getProject,
getProjects,
} = require('./controller/project');
const {
startPoll,
closePoll,
makePayment,
testPermit
} = require('./controller/admin');
const {
getRate,
sendCoin,
} = require('./controller/external');
router.post('/users/auth', getUserAuthorization);
router.post('/projects/', addNewProject);
router.put('/projects/', editProject);
router.post('/projects/one', getProject);
router.post('/projects/all', getProjects);
// router.post('/user', createUser);
router.post('/users/adscount', protect, increaseAdsCount);
router.post('/users/adstokencount', protect, getAdsAndTokenCount);
router.post('/users/token/transfer', protect, requestTokenTransfer);
router.post('/poll/vote', protect, submitVote);
router.post('/admin/startpoll', protectAdmin, startPoll);
router.post('/admin/closepoll', protectAdmin, closePoll);
router.post('/admin/payout', protectAdmin, makePayment);
router.post('/admin/permit', testPermit);
// router.post('/users/poll/current', protect, getCurrentPoll);
// router.post('/users/poll/proposals', protect, getCurrentProposals);
// router.post('/users/poll/proposal', getOneProposal, getCurrentProposals);
router.post('/exchange/rate', getRate);
// router.post('/exchange/coin/send', sendCoin);
export = { router };