Merge admin config into strapic config

This commit is contained in:
Alexandre Bodin 2021-08-03 08:33:47 +02:00
parent d44a6f68ee
commit a0011840e8
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
admin: {
autoOpen: true,
auth: {
secret: env('ADMIN_JWT_SECRET', 'example-token'),
},

View File

@ -327,6 +327,11 @@ class Strapi {
const modules = await loadModules(this);
this.admin = require('@strapi/admin/strapi-server');
// TODO: rename into just admin and ./config/admin.js
const userAdminConfig = strapi.config.get('server.admin');
this.config.set('server.admin', _.merge(this.admin.config, userAdminConfig));
this.api = modules.api;
this.components = modules.components;
this.plugins = modules.plugins;