|
2 | 2 | import * as dotenv from 'dotenv' |
3 | 3 | import express from "express"; |
4 | 4 | import path from "path"; |
5 | | -import cookieParser from "cookie-parser"; |
6 | | -import logger from "morgan"; |
7 | 5 | import { initialize } from "express-openapi"; |
8 | 6 | import swaggerUi from "swagger-ui-express"; |
9 | 7 | import ApiDocs from "./api/api-doc.json" |
10 | 8 | import bodyParser from "body-parser"; |
11 | 9 | import cors from "cors"; |
12 | 10 | import {addContextMiddle} from "./api/addContextMiddle" |
13 | 11 | import { createProxyMiddleware } from 'http-proxy-middleware' |
14 | | -import TerminusClient , {WOQLClient,WOQL, AccessControl} from "@terminusdb/terminusdb-client" |
| 12 | +import { AccessControl} from "@terminusdb/terminusdb-client" |
| 13 | +import * as settings from './api/core/settings' |
15 | 14 | declare namespace Express { |
16 | 15 | export interface Request { |
17 | 16 | context?: object |
@@ -69,13 +68,9 @@ app.use(addContextMiddle) |
69 | 68 | app.listen(3035,function(){ |
70 | 69 | // when we start the server we check if the terminusCR team already exists |
71 | 70 | // if it does not exists we'll create it |
72 | | - const endpoint :string = process.env.SERVER_ENDPOINT || "http://127.0.0.1:6363" |
73 | | - const key = process.env.USER_KEY || "root" |
74 | | - const CROrg = process.env.CR_TEAM_NAME || "terminusCR" |
75 | | - const user = process.env.USER_NAME || "admin" |
76 | | - const accessControl = new AccessControl(endpoint, { key: key, user: user }) |
| 71 | + const accessControl = new AccessControl(settings.endpoint, { key: settings.key, user: settings.user }) |
77 | 72 |
|
78 | | - accessControl.createOrganization(CROrg).then(result=>{ |
| 73 | + accessControl.createOrganization(settings.CROrg).then(result=>{ |
79 | 74 | console.log("The Change Request team has been created") |
80 | 75 | }).catch((err:any)=>{ |
81 | 76 | if (typeof err.data === 'object' && err.data['api:error'] |
|
0 commit comments