Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 902 Bytes

README.md

File metadata and controls

25 lines (19 loc) · 902 Bytes

koa-cms

A cms site of koa framework.

Firstly, install mongodb and run npm install and npm start to start the site.

Next, you need a few records in the database to start using the user system.

Run these commands on mongo via the terminal. Obviously you should use your own email address.

default password: asdf

use koa-cms; // or your MongoDB's db name if different
db.admingroups.insert({ _id: 'root', name: 'Root' });
db.admins.insert({ name: {first: 'Root', last: 'Admin', full: 'Root Admin'}, groups: ['root'] });
var rootAdmin = db.admins.findOne();
db.users.save({ username: 'root', isActive: true, email: 'your@email.addy', password: '$2a$10$mK2IhtqOCifD5/YH2GQPl.odhjcy4ENXNBkqanC0fMAxfPj1bWy2u', roles:{admin: rootAdmin._id} });
var rootUser = db.users.findOne();
rootAdmin.user = { id: rootUser._id, name: rootUser.username };
db.admins.save(rootAdmin);