meteor-admin icon indicating copy to clipboard operation
meteor-admin copied to clipboard

[QUESTION] Where do you add the AdminConfig ?

Open johhansantana opened this issue 7 years ago • 6 comments

It's said that you need to add it both in client and server side, but where do I add this configuration?

AdminConfig = {
  adminEmails: ['[email protected]'],
  collections:
    {
      Posts: {},
      Comments: {}
    }
}

johhansantana avatar Apr 07 '17 16:04 johhansantana

under the /lib directory #384

Fotso avatar May 05 '17 13:05 Fotso

i couldnt see this updated today in the readme doc. quite useful info for someone just getting started...

laurencefass avatar Jun 15 '17 14:06 laurencefass

inadequate documentation is generally an with software issue. why come to the issue queue to answer basic config questions?

laurencefass avatar Jun 20 '17 12:06 laurencefass

why waste peoples valuable time with poorly documented software? based on the arrogant response and combined poor documentation i'm not going to bother testing this software further. what if i hit a more complex problem? more of the same? no thanks...

laurencefass avatar Jun 20 '17 14:06 laurencefass

@laurencefass I fully understand your disappointment, i also faced the same problem and i have now a bad feeling to this project. Did you find any alternative way to implement a meteor admin frontend ?

reda134 avatar Aug 16 '18 01:08 reda134

option 1

from @Fotso https://github.com/yogiben/meteor-admin/issues/384#issuecomment-299458050

create a lib directory at root of your project and create a file AdminConfig.js with

AdminConfig =
{
	adminEmails: ['[email protected]'], 
	collections:
	{
			Posts: {}
	}
};

inside.

option 2

From https://github.com/yogiben/meteor-admin/issues/77#issuecomment-70686682 :

in main/server.js : global.AdminConfig = AdminConfig; in main /client.js : window.AdminConfig = AdminConfig;

And AdminConfig can be defined in a shared/config.js :

export const AdminConfig =
{
	adminEmails: ['[email protected]'], 
	collections:
	{
			Posts: {}
	}
};

and imported like so (in main.js server and client) : import { AdminConfig } from '/shared/config.js';

Note : I used server, client and shared folders because it is the structure of my app but it can be done differently (using Meteor.isClient()...).

capi1O avatar Oct 15 '18 07:10 capi1O