Rémi de Juvigny 2a9b9b61cf
chore: improve getstarted dummy preview page (#24091)
* chore: improve getstarted dummy preview page

* chore: adrien feedback
2025-08-04 10:42:46 -04:00

40 lines
1.1 KiB
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'),
},
},
secrets: {
encryptionKey: env('ENCRYPTION_KEY', 'example-key'),
},
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 }) => {
const contentType = strapi.contentType(uid);
const kind = contentType.kind === 'collectionType' ? 'collection-types' : 'single-types';
const apiName =
contentType.kind === 'collectionType'
? contentType.info.pluralName
: contentType.info.singularName;
return `/admin/preview/${kind}/${apiName}/${documentId}/${locale}/${status}`;
},
},
},
});