-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystone.ts
36 lines (32 loc) · 1.1 KB
/
keystone.ts
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
28
29
30
31
32
33
34
35
36
// Welcome to Keystone!
//
// This file is what Keystone uses as the entry-point to your headless backend
//
// Keystone imports the default export of this file, expecting a Keystone configuration object
// you can find out more at https://keystonejs.com/docs/apis/config
import 'dotenv/config';
import { config } from '@keystone-6/core';
// to keep this file tidy, we define our schema in a different file
import { lists } from './schema';
// authentication is configured separately here too, but you might move this elsewhere
// when you write your list-level access control functions, as they typically rely on session data
import { withAuth, session } from './auth';
export default withAuth(
config({
db: {
// we're using sqlite for the fastest startup experience
// for more information on what database might be appropriate for you
// see https://keystonejs.com/docs/guides/choosing-a-database#title
provider: 'sqlite',
url: 'file:./keystone.db',
},
lists,
server: {
cors: {
credentials: false,
origin: "*"
},
},
session,
})
);