This repository was archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
69 lines (64 loc) · 1.57 KB
/
app.js
File metadata and controls
69 lines (64 loc) · 1.57 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env node
/**
* @file
* This is the main application that uses architect to build the application
* base on plugins.
*/
var path = require('path');
var architect = require("architect");
// Load config file.
var config = require(__dirname + '/config.json');
// Configure the plugins.
var plugins = [
{
"packagePath": "./plugins/logger",
"logs": config.logs
},
{
"packagePath": "./plugins/server",
"port": config.port,
"path": path.join(__dirname, 'public')
},
{
"packagePath": "./plugins/apikeys",
"file": __dirname + '/' + config.apikeys
},
{
"packagePath": "./plugins/mappings",
"file": __dirname + '/' + config.search.mappings
},
{
"packagePath": "./plugins/auth",
"secret": config.secret,
"admin": config.admin
},
{
"packagePath": "./plugins/admin",
"secret": config.secret
},
{
"packagePath": "./plugins/socket",
"secret": config.secret,
"monitor": config.hasOwnProperty('monitor') ? config.monitor : false
},
{
"packagePath": "./plugins/search",
"hosts": config.search.hosts,
"settings": config.hasOwnProperty('config.search.settings') ? config.search.settings : {}
},
{
"packagePath": "./plugins/api",
"secret": config.secret
},
{
"packagePath": "./plugins/search_client",
"monitor": config.hasOwnProperty('monitor') ? config.monitor : false
}
];
// User the configuration to start the application.
config = architect.resolveConfig(plugins, __dirname);
architect.createApp(config, function (err, app) {
if (err) {
throw err;
}
});