diff --git a/server/controllers/api/config/site/publishing/index.js b/server/controllers/api/config/site/publishing/index.js new file mode 100644 index 00000000..08e60bf3 --- /dev/null +++ b/server/controllers/api/config/site/publishing/index.js @@ -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; diff --git a/server/routes/api/index.js b/server/routes/api/index.js index 0aabd472..05c4973c 100644 --- a/server/routes/api/index.js +++ b/server/routes/api/index.js @@ -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); };