Marc Roig 840550dc97
feat: preview config (#21561)
* feat: base files for static preview

* feat: preview config

* Update packages/core/content-manager/server/src/preview/routes/index.ts

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>

* chore: empty handler

* chore: comment controllers type

* fix: remove is enabled check from load

* feat: test preview config

* chore: refactor type

* fix: pr comments

---------

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
2024-10-07 21:16:25 +02:00

30 lines
687 B
JavaScript

module.exports = ({ env }) => ({
// autoOpen: false,
auth: {
secret: env('ADMIN_JWT_SECRET', 'example-token'),
},
apiToken: {
salt: env('API_TOKEN_SALT', 'example-salt'),
},
auditLogs: {
enabled: env.bool('AUDIT_LOGS_ENABLED', true),
},
transfer: {
token: {
salt: env('TRANSFER_TOKEN_SALT', 'example-salt'),
},
},
flags: {
nps: env.bool('FLAG_NPS', true),
promoteEE: env.bool('FLAG_PROMOTE_EE', true),
},
preview: {
enabled: env.bool('PREVIEW_ENABLED', true),
config: {
handler: (uid, { documentId, locale, status }) => {
return `/preview/${uid}/${documentId}/${locale}/${status}`;
},
},
},
});