2018-04-27 18:54:36 +02:00
|
|
|
const channelAvailability = require('../../controllers/api/channel/availability');
|
|
|
|
const channelClaims = require('../../controllers/api/channel/claims');
|
|
|
|
const channelData = require('../../controllers/api/channel/data');
|
|
|
|
const channelShortId = require('../../controllers/api/channel/shortId');
|
|
|
|
const claimAvailability = require('../../controllers/api/claim/availability');
|
2018-04-30 00:30:11 +02:00
|
|
|
const claimBlockedList = require('../../controllers/api/claim/blockedList');
|
2018-04-27 18:54:36 +02:00
|
|
|
const claimData = require('../../controllers/api/claim/data/');
|
|
|
|
const claimGet = require('../../controllers/api/claim/get');
|
2018-04-30 00:30:11 +02:00
|
|
|
const claimList = require('../../controllers/api/claim/list');
|
2018-04-27 18:54:36 +02:00
|
|
|
const claimLongId = require('../../controllers/api/claim/longId');
|
|
|
|
const claimPublish = require('../../controllers/api/claim/publish');
|
|
|
|
const claimResolve = require('../../controllers/api/claim/resolve');
|
|
|
|
const claimShortId = require('../../controllers/api/claim/shortId');
|
|
|
|
const fileAvailability = require('../../controllers/api/file/availability');
|
2018-05-31 03:52:13 +02:00
|
|
|
const userPassword = require('../../controllers/api/user/password');
|
2018-06-23 23:12:50 +02:00
|
|
|
const publishingConfig = require('../../controllers/api/config/site/publishing');
|
2018-03-29 02:35:41 +02:00
|
|
|
|
2018-06-27 23:23:14 +02:00
|
|
|
const multipartMiddleware = require('../../middleware/multipartMiddleware');
|
|
|
|
const torCheckMiddleware = require('../../middleware/torCheckMiddleware');
|
2018-03-29 20:24:52 +02:00
|
|
|
|
|
|
|
module.exports = (app) => {
|
|
|
|
// channel routes
|
|
|
|
app.get('/api/channel/availability/:name', channelAvailability);
|
|
|
|
app.get('/api/channel/short-id/:longId/:name', channelShortId);
|
|
|
|
app.get('/api/channel/data/:channelName/:channelClaimId', channelData);
|
|
|
|
app.get('/api/channel/claims/:channelName/:channelClaimId/:page', channelClaims);
|
|
|
|
// claim routes
|
|
|
|
app.get('/api/claim/availability/:name', claimAvailability);
|
2018-04-30 00:30:11 +02:00
|
|
|
app.get('/api/claim/blocked-list/', claimBlockedList);
|
|
|
|
app.get('/api/claim/data/:claimName/:claimId', claimData);
|
|
|
|
app.get('/api/claim/get/:name/:claimId', claimGet);
|
|
|
|
app.get('/api/claim/list/:name', claimList);
|
2018-06-23 00:28:35 +02:00
|
|
|
app.post('/api/claim/long-id', claimLongId); // should be a get
|
2018-06-27 23:23:14 +02:00
|
|
|
app.post('/api/claim/publish', torCheckMiddleware, multipartMiddleware, claimPublish);
|
2018-04-30 00:30:11 +02:00
|
|
|
app.get('/api/claim/resolve/:name/:claimId', claimResolve);
|
2018-03-29 20:24:52 +02:00
|
|
|
app.get('/api/claim/short-id/:longId/:name', claimShortId);
|
|
|
|
// file routes
|
|
|
|
app.get('/api/file/availability/:name/:claimId', fileAvailability);
|
2018-05-31 03:52:13 +02:00
|
|
|
// user routes
|
|
|
|
app.put('/api/user/password/', userPassword);
|
2018-06-23 23:12:50 +02:00
|
|
|
// configs
|
|
|
|
app.get('/api/config/site/publishing', publishingConfig);
|
2018-03-29 02:35:41 +02:00
|
|
|
};
|