-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
62 lines (53 loc) · 1.14 KB
/
config.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Your Config File.
* See https://xpresserjs.com/configuration/
*/
import env from "./env";
import {parseServerUrl} from "xpress-mongo";
/**
* Parse MongoDB URL
*/
const mongoUrl = parseServerUrl(env.DB_SERVER, {
dbname: env.DB_NAME,
password: env.DB_PASSWORD
});
export = {
// name of app
name: env.APP_NAME,
// app environment
env: env.NODE_ENV,
/**
* By default, xpresser sets this for you.
*/
server: {
domain: env.APP_HOST,
// Server Port
port: env.APP_PORT
},
/**
* Path settings.
*/
paths: {
/**
* Base Folder
* Where this app is called from.
*
* Best value for this is: __dirname
*/
base: __dirname,
/**
* Point routes file to routes.ts
*/
routesFile: "backend://routes.ts"
},
/**
* If Enabled, xjs make:model will generate Models
* that requires you to define all data types.
*/
useStrictTypescriptModels: true, // >=v1.0.0
// Connection Config
mongodb: {
url: mongoUrl,
database: env.DB_NAME,
}
};