@rpcbase/server 0.265.0 → 0.267.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/bin.js
CHANGED
|
@@ -31,7 +31,14 @@ const args = yargs(hideBin(process.argv))
|
|
|
31
31
|
.option("session", {
|
|
32
32
|
hidden: true,
|
|
33
33
|
})
|
|
34
|
-
.command("start", "runs server/infrastructure", () => {
|
|
34
|
+
.command("start", "runs server/infrastructure", (yargs) => {
|
|
35
|
+
yargs
|
|
36
|
+
.option("docker", {
|
|
37
|
+
type: "boolean",
|
|
38
|
+
default: false,
|
|
39
|
+
description: "Run in docker"
|
|
40
|
+
})
|
|
41
|
+
}, (args) => {
|
|
35
42
|
is_command = true
|
|
36
43
|
check_args(args)
|
|
37
44
|
start_server_infrastructure(args)
|
|
@@ -4,15 +4,14 @@ const fs = require("fs")
|
|
|
4
4
|
|
|
5
5
|
const run_docker = require("./run_docker")
|
|
6
6
|
const run_native = require("./run_native")
|
|
7
|
-
const get_runtime = require("./get_runtime")
|
|
8
7
|
|
|
9
8
|
// TODO: auto create network if necessary
|
|
10
|
-
// docker network create
|
|
9
|
+
// docker network create ${RB_INSTANCE_NAME}-network
|
|
11
10
|
|
|
12
11
|
const start_server = async(args) => {
|
|
13
12
|
const infrastructure_dir = path.join(process.cwd(), "../infrastructure")
|
|
14
13
|
|
|
15
|
-
const runtime =
|
|
14
|
+
const runtime = args.docker ? "docker" : "native"
|
|
16
15
|
|
|
17
16
|
// prefix
|
|
18
17
|
const proj_parent_dir = path.join(infrastructure_dir, "../../")
|
|
@@ -22,8 +21,6 @@ const start_server = async(args) => {
|
|
|
22
21
|
run_docker(infrastructure_dir, proj_prefix, args)
|
|
23
22
|
} else if (runtime === "native") {
|
|
24
23
|
run_native(infrastructure_dir, proj_prefix, args)
|
|
25
|
-
} else {
|
|
26
|
-
throw new Error("unknown runtime")
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
|
package/database.js
CHANGED
|
@@ -26,6 +26,8 @@ if (typeof DATABASE_NAME !== "string") {
|
|
|
26
26
|
throw new Error("expected DATABASE_NAME to be a string")
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
console.log("IS DOCKERRRRR", is_docker())
|
|
30
|
+
|
|
29
31
|
const hostname = is_docker() ? "database" : "127.0.0.1"
|
|
30
32
|
|
|
31
33
|
const mongo_url = `mongodb://${hostname}:${DATABASE_PORT}/${DATABASE_NAME}?directConnection=true&replicaSet=rs0`
|
package/package.json
CHANGED