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
24 lines (21 loc) · 644 Bytes
/
index.js
File metadata and controls
24 lines (21 loc) · 644 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
const dotenv = require('dotenv-safe')
dotenv.config()
const {
PORT = 4000,
DB_PASS: rootPass,
DB_URL: url,
DB_NAME: databaseName,
} = process.env
const { ArangoTools } = require('arango-tools')
const { Server } = require('./src/server')
const { makeMigrations } = require('./migrations')
;(async () => {
const { migrate } = await ArangoTools({ rootPass, url })
const { query, collections, transaction } = await migrate(
makeMigrations({ databaseName, rootPass }),
)
Server({ query, collections, transaction }).listen(PORT, (err) => {
if (err) throw err
console.log(`🚀 API listening on port ${PORT}`)
})
})()