added a route to return publishing configs

This commit is contained in:
bill bittner 2018-06-23 14:12:50 -07:00
parent 391592f1b8
commit 5db0d3f6b8
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,29 @@
const { publishing: {
primaryClaimAddress,
uploadDirectory,
thumbnailChannel,
thumbnailChannelId,
additionalClaimAddresses,
disabled,
disabledMessage
} } = require('@config/siteConfig');
/*
route to see if publishing is enabled
*/
const publishingConfig = (req, res) => {
return res.status(200).json({
primaryClaimAddress,
uploadDirectory,
thumbnailChannel,
thumbnailChannelId,
additionalClaimAddresses,
disabled,
disabledMessage
});
};
module.exports = publishingConfig;

View file

@ -13,6 +13,7 @@ const claimResolve = require('../../controllers/api/claim/resolve');
const claimShortId = require('../../controllers/api/claim/shortId');
const fileAvailability = require('../../controllers/api/file/availability');
const userPassword = require('../../controllers/api/user/password');
const publishingConfig = require('../../controllers/api/config/site/publishing');
const multipartMiddleware = require('../utils/multipartMiddleware');
@ -36,4 +37,6 @@ module.exports = (app) => {
app.get('/api/file/availability/:name/:claimId', fileAvailability);
// user routes
app.put('/api/user/password/', userPassword);
// configs
app.get('/api/config/site/publishing', publishingConfig);
};