forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (34 loc) · 936 Bytes
/
Copy pathindex.js
File metadata and controls
37 lines (34 loc) · 936 Bytes
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
37
import './src/env'
import { ArangoTools } from 'arango-tools'
import { Server } from './src/server'
import { makeMigrations } from './migrations'
const {
PORT = 4000,
DB_PASS: rootPass,
DB_URL: url,
DB_NAME: databaseName,
DEPTH_LIMIT: maxDepth,
COST_LIMIT: complexityCost,
SCALAR_COST: scalarCost,
OBJECT_COST: objectCost,
LIST_FACTOR: listFactor,
} = process.env
;(async () => {
const { migrate } = await ArangoTools({ rootPass, url })
const { query, collections, transaction } = await migrate(
makeMigrations({ databaseName, rootPass }),
)
Server(PORT, maxDepth, complexityCost, scalarCost, objectCost, listFactor, {
query,
collections,
transaction,
}).listen(PORT, (err) => {
if (err) throw err
console.log(
`🚀 Server ready at http://localhost:${PORT}/graphql`,
)
console.log(
`🚀 Subscriptions ready at ws://localhost:${PORT}/graphql`,
)
})
})()