forked from keystonejs/keystone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (24 loc) · 891 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { Keystone } = require('@keystonejs/keystone');
const { MongooseAdapter } = require('@keystonejs/adapter-mongoose');
const { Text } = require('@keystonejs/fields');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');
const { StaticApp } = require('@keystonejs/app-static');
const keystone = new Keystone({
adapter: new MongooseAdapter({ mongoUri: 'mongodb://localhost/todo' }),
});
keystone.createList('Todo', {
schemaDoc: 'A list of things which need to be done',
fields: {
name: { type: Text, schemaDoc: 'This is the thing you need to do', isRequired: true },
},
});
module.exports = {
keystone,
apps: [
new GraphQLApp(),
new StaticApp({ path: '/', src: 'public' }),
// Setup the optional Admin UI
new AdminUIApp({ name: 'Keystone To-Do List', enableDefaultRoute: true }),
],
};