added a route to return publishing configs
This commit is contained in:
parent
391592f1b8
commit
5db0d3f6b8
2 changed files with 32 additions and 0 deletions
29
server/controllers/api/config/site/publishing/index.js
Normal file
29
server/controllers/api/config/site/publishing/index.js
Normal 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;
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue