@rpcbase/server 0.68.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/run_native.js +41 -23
- package/package.json +1 -1
package/cli/run_native.js
CHANGED
|
@@ -26,38 +26,56 @@ const init_processes = () => {
|
|
|
26
26
|
|
|
27
27
|
// create data dirs
|
|
28
28
|
const db_path = path.join(process.cwd(), "../infrastructure/data/database/db/")
|
|
29
|
-
if (!fs.existsSync(db_path)) {
|
|
30
|
-
mkdirp.sync(db_path)
|
|
31
|
-
}
|
|
32
29
|
const db_logs_path = path.join(process.cwd(), "../infrastructure/data/database/log/")
|
|
33
|
-
if (!fs.existsSync(db_logs_path)) {
|
|
34
|
-
mkdirp.sync(db_logs_path)
|
|
35
|
-
}
|
|
36
30
|
|
|
31
|
+
const session_store_dir = path.join(process.cwd(), "../infrastructure/data/session-store/data")
|
|
37
32
|
|
|
33
|
+
// TODO: add a redis cache
|
|
38
34
|
const processes = [
|
|
39
35
|
// web server
|
|
40
36
|
// TODO: do not use yarn dev server command
|
|
41
|
-
{
|
|
37
|
+
{
|
|
38
|
+
name: "server",
|
|
39
|
+
dirs: [],
|
|
40
|
+
cmd: ["yarn", ["dev"]]
|
|
41
|
+
},
|
|
42
42
|
// mongodb database
|
|
43
|
-
{
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
{
|
|
44
|
+
name: "database",
|
|
45
|
+
dirs: [
|
|
46
|
+
db_path, db_logs_path
|
|
47
|
+
],
|
|
48
|
+
cmd: ["mongod", [
|
|
49
|
+
"--quiet",
|
|
50
|
+
"--dbpath", db_path,
|
|
51
|
+
"--port", env.DATABASE_PORT,
|
|
52
|
+
// "--bind_ip_all",
|
|
53
|
+
// "--logpath", "/var/log/logs.txt",
|
|
54
|
+
"--replSet", "rs0"
|
|
55
|
+
]]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "session-store",
|
|
59
|
+
dirs: [
|
|
60
|
+
session_store_dir,
|
|
61
|
+
],
|
|
62
|
+
cmd: ["redis-server", [
|
|
63
|
+
path.join(infrastructure_conf_dir, "./redis/redis.conf"),
|
|
64
|
+
"--dir", session_store_dir,
|
|
65
|
+
"--port", env.SESSION_STORE_PORT,
|
|
66
|
+
]]
|
|
67
|
+
},
|
|
59
68
|
]
|
|
60
69
|
|
|
70
|
+
// create missing directories
|
|
71
|
+
processes.forEach((item) => {
|
|
72
|
+
item.dirs.forEach((dir) => {
|
|
73
|
+
if (!fs.existsSync(dir)) {
|
|
74
|
+
mkdirp.sync(dir)
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
|
|
61
79
|
return processes
|
|
62
80
|
}
|
|
63
81
|
|