How to use the @keystonejs/app-admin-ui.AdminUIApp function in @keystonejs/app-admin-ui

To help you get started, we’ve selected a few @keystonejs/app-admin-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keystonejs / keystone / demo-projects / blog / index.js View on Github external
await keystone.createItems(initialData);
    }
  },
});

const authStrategy = keystone.createAuthStrategy({
  type: PasswordAuthStrategy,
  list: 'User',
});

keystone.createList('User', User);
keystone.createList('Post', Post);
keystone.createList('PostCategory', PostCategory);
keystone.createList('Comment', Comment);

const adminApp = new AdminUIApp({
  adminPath: '/admin',
  hooks: require.resolve('./admin/'),
  authStrategy,
  isAccessAllowed: ({ authentication: { item: user } }) => !!user && !!user.isAdmin,
});

module.exports = {
  keystone,
  apps: [
    new GraphQLApp(),
    new StaticApp({ path: staticRoute, src: staticPath }),
    adminApp,
    new NextApp({ dir: 'app' }),
  ],
  distDir,
};

@keystonejs/app-admin-ui

KeystoneJS Admin UI App.

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular @keystonejs/app-admin-ui functions

Similar packages