-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
39 lines (35 loc) · 1.05 KB
/
config.js
File metadata and controls
39 lines (35 loc) · 1.05 KB
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
// Check if MONGODB_URI environment variable is set
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/';
const databaseConfiguration = {
uri: MONGODB_URI,
databaseName: 'Forecast-API',
collectionName: 'users',
usersCollectionSchema: {
$jsonSchema: {
bsonType: 'object',
required: ['name', 'email', 'city'],
properties: {
name: {
bsonType: 'string',
description: 'must be a string and is required'
},
email: {
bsonType: 'string',
description: 'must be a string and is required',
pattern: '^.+@.+$'
},
city: {
bsonType: 'string',
description: 'must be a string and is required'
}
}
}
}
};
const serverConfiguration = {
port: process.env.PORT || 3000
};
module.exports = {
databaseConfiguration,
serverConfiguration
};